简体   繁体   中英

Docker container shutting down upon start

I am trying to build and run container where I can start tomcat ( I know I can find direct image but wanted to do by my own for learning )

When I am running it, it's getting down automatically,

I checked log, it says Tomcat started

docker build -t hanuman .

docker run -i -t  -p 80:8080  hanuman 

docker run -i -t  -p 80:8080  hanuman --entrypoint /bin/sh tail -f /dev/null

My Docker file

FROM ubuntu:16.04

RUN apt-get update

RUN apt-get install -y openjdk-8-jdk

ADD tomcat8 /usr/local/tomcat8

RUN cd home

RUN ls -lrt

RUN chmod 777 -R /usr/local/tomcat*

EXPOSE 8080 8009 443

ENTRYPOINT  ./usr/local/tomcat8/bin/catalina.sh start

You want to use catalina.sh run such that the process does not terminate. start would start tomcat in background and then terminate.

ENTRYPOINT  ./usr/local/tomcat8/bin/catalina.sh run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM