I was trying to start up a web application in a docker container
here is my dockerfile
FROM centos:6
EXPOSE 9980
RUN yum install -y wget
RUN wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.rpm"
RUN yum localinstall -y jdk-8u60-linux-x64.rpm
RUN mkdir /usr/local/apps
WORKDIR /usr/local/apps
COPY ac-gui ac-gui/
RUN mv /etc/localtime /etc/localtime.bak
RUN ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
RUN chmod 775 ac-gui/start.sh ac-gui/stop.sh
ENTRYPOINT ["ac-gui/start.sh"]
start.sh
#!/bin/sh
export APP_HOME=/usr/local/apps/ac-gui
export JAVA_HOME=/usr/java/jdk1.8.0_60
export PATH=$JAVA_HOME/bin:$PATH
export PID_FILE=$APP_HOME/ac-gui.pid
cd $APP_HOME
$JAVA_HOME/bin/java -server -jar ac-gui.war --spring.config.name=ac-gui >> ac-gui.log 2>&1 &
echo "$!" > "$PID_FILE"
if I run
docker run -i -t -p 9980:9980 ac-gui bash
and run ac-gui/start.sh inside the container, it works fine for me.
but if I just run the container as
docker run -d -p 9980:9980 ac-gui
the container will be exited (0).
is there anything I did wrong?