nginx - Keep Docker running when shell script exits -


i have following docker file.

from ubuntu run apt-get update expose 9000:80  # install nginx run apt-get install -y nginx  # install curl run apt-get -qq update run apt-get -qq -y install curl entrypoint service nginx start 

when try run following commands in shell script, docker image created , container started, however, when shell script exits, docker container stopped.

how can keep docker container running after shell script exits ? idea have running container nginx running on port 80 can accessed host using port 9000.

don't run nginx background service. launch in foreground nginx container on hub.docker.com does:

cmd ["nginx", "-g", "daemon off;"] 

with containers, when pid 1 dies, container dies. it's identical when kill pid 1 (init) on linux machine.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -