Answer the question
In order to leave comments, you need to log in
How to properly use Docker data volumes?
Hello!
In the principle, I figured out how to use "data volumes" and what they are for, but I don't understand why, for the place where the data volumes container is created, do not use the -v some_dir:some_dir
.
Examples for Postgres (docker-compose)
1. data volumes:
postgres:
image: postgres:9.5
volumes_from:
- postgres-data
postgres-data:
image: busybox
volumes:
- /var/lib/postgresql/data
postgres:
image: postgres:9.5
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question