Layered docker image

27 views
Skip to first unread message

Manoj Chander

unread,
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 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  .

Dockerfile(2)

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

Regards ,
Manoj 






Reply all
Reply to author
Forward
0 new messages