Layered docker image

Skip to first unread message

Manoj Chander

Jul 19, 2021, 1:33:21 PM7/19/21
to docker-dev
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):

FROM tomcat:8.5-alpine
COPY app1.war /usr/local/tomcat/conf 
CMD 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  .


FROM app1 
COPY app2.war /webapps/
CMD sh && run
CMD sh /opt/

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 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

Regards ,

Reply all
Reply to author
0 new messages