Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Data Volume Container Correctly #49

Open
gekart opened this issue Feb 9, 2017 · 0 comments
Open

Use Data Volume Container Correctly #49

gekart opened this issue Feb 9, 2017 · 0 comments

Comments

@gekart
Copy link

gekart commented Feb 9, 2017

Use data volume containers using host mounted paths as recommended by Docker. What you do here is suggesting users to run a data container using container FS path. IE users will lose their data if they destroy the data container.

Pasting in the suggested procedure from Docker:

Creating and mounting a data volume container

If you have some persistent data that you want to share between containers, or want to use from non-persistent containers, it’s best to create a named Data Volume Container, and then to mount the data from it.

Let’s create a new named container with a volume to share. While this container doesn’t run an application, it reuses the training/postgres image so that all containers are using layers in common, saving disk space.

$ docker create -v /dbdata --name dbstore training/postgres /bin/true
You can then use the --volumes-from flag to mount the /dbdata volume in another container.

$ docker run -d --volumes-from dbstore --name db1 training/postgres

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant