How do i set propagation for named volumes?
I want to share files between replicas, other containers and the host, what should i add to this. It's v3.
database:
driver: local
driver_opts:
o: bind
type: bind
device:/my/directory
@nghianv19940
Please take a look at below documentation for docker compose volume :)
https://docs.docker.com/storage/volumes/
Please take a look at below documentation for docker compose volume :)
It's not at all clear from that page how to define propagation in the top-level volumes key of a ./docker-compose.yml file as in the description, @maxcleme.
propagation is an option of mount, so this is not to be declared by top-level volume definition, but by mount per services
services:
test:
volumes:
- type: bind
source: my_volume
target: /test
bind:
propagation: shared
propagation is an option of
mount, so this is not to be declared by top-level volume definition, but by mount per services
Oh! That helps me understand what I was misunderstanding, thanks much!
propagation is an option of
mount, so this is not to be declared by top-level volume definition, but by mount per services
Hmm, that doesn't seem to work. From ./docker-compose.yml:
services:
foo:
image: "ubuntu"
volumes:
- type: bind
source: "media_library"
target: "/media/Library/"
bind:
propagation: "shared"
entrypoint: >-
sleep 999
volumes:
media_library:
name: "media_library"
driver: "local"
driver_opts:
type: "ext4"
device: "/dev/mapper/_dev_md127p1"
Then I get this error when running the container:
# docker compose run --rm foo
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /media/Crypt/srv/library/media_library