I want to create a layered docker image .ie... i have a APP1 docker image it deploys a webapp to tomcat when i run it .
APP1 Dockerfile (1):
COPY app1.war /usr/local/tomcat/conf
CMD sh my-int.sh && catalina.sh run .
I build this image ( $ docker build . -t app1 )
I have to create a APP2 image which makes use of the above app1 images tomcat .
COPY app2.war /webapps/
CMD sh my-int.sh && catalina.sh run
CMD sh /opt/My_healthcheck.sh
The tomcat never starts only my healthcheck script is running in background .
however if i Remove the health check script tomcat and run the same file tomcat gets started .
and if i curl the health check url manualy it succeds .
But if i run them in order from dockerfile catalina.sh doesnt get triggered .
Is my approach wrong .should i just used docke-rcompose and run app1 as a service and just copy my app2 war to the service