Data-only container

Data can be stored outside the Docker UFS in a data-only container. The data will be visible inside the data-only container mount namespace. As the data is persisted outside the container, it remains even after the container is deleted. If any other container wants to connect to this data-only container, simply use the --volumes-from option to grab the container and apply it to the current container. Let's try out data volume container:

Data-only container

Using a data-only container

Creating a data-only container

$ docker create -v /tmp --name ubuntuvolume Ubuntu:14.04

In the preceding command, we created an Ubuntu container and attached /tmp

Get Troubleshooting Docker now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.