linux - why is my docker container not working -


i trying start web application in docker container

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

docker run -i -t -p 9980:9980 ac-gui bash

and run ac-gui/start.sh inside container, works fine me.

but if run container as

docker run -d -p 9980:9980 ac-gui  

the container exited (0).

is there did wrong?

i found out cause of problem this question

so remove & in start.sh resolve problem


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -