Docker Community Forums

Share and learn in the Docker community.

Docker Container getting killed by itself


(Sujit) #1

I have created an image of my own, which has ubuntu/puppet as its base image and then am running an ENTRYPOINT script in it.
Image gets created successfully, but when i run a container for this image, it gets killed once the entrypoint script gets executed successfully(the exit status of last command in the ENTRYPOINT is ‘0’) .

Any idea, how to overcome this issue.

(Ranjandas) #2

Hi Sujit,

That is the default behaviour of docker containers. When the process that is called at the container startup executes (ENTRYPOINT/CMD) and exits, the container will exit. If you want the container to stay running you should make the ENTRYPOINT/CMD script to run in foreground without exiting.

Please let us know the contents of your entrypoint script or the service which you are trying to run so that we can help you more.