Search code examples
dockervolumes

Docker initializing volume exiting container


I am running scripts from:

https://www.tutorialspoint.com/docker/docker_storage.htm > Data Volumes

When I want to perform such script:

docker run -d -v /home/docker/demo:/nexus-data --name="volume" sonatype/nexus3

I see on container list that volume container is Up and running but after few seconds it state change to Exited, why?


Solution

  • A docker container exits when the main process finishes. For example if you execute a command that will generate some output - it will execute it (depend of settings save it) and exit.