O'Reilly logo

Build Your Own PaaS with Docker by Oskar Hane

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running a data volume container

Data volume containers are special; they can be stopped and still fulfill their purpose. Personally, I like to see all containers in use when executing docker ps command, since I like to delete stopped containers once in a while.

This is totally up to you. If you're okay with keeping the container stopped, you can start it using this command:

docker run –d oskarhane/data true

The true argument is just there to enter a valid command, and the –d argument places the container in detached mode, running in the background.

If you want to keep the container running, you need to place a service in the foreground, like this:

docker run –d oskarhane/data tail –f /dev/null

The output of the preceding command is as follows:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required