Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change docker-compose propagation settings

Tags:

docker

I trying to change the propagation settings of docker compose. Below is my yaml file.

version: '3.2'
services:
  web:
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - "3000:3000"
    volumes:
      - /app/node_modules
      - type: bind
        source: .
        target: /app
        bind:
          propagation: shared

However when I docker-inspect the container the volume is still rprivate.

"Mounts": [
            {
                "Type": "bind",
                "Source": "/c/users/pinku/Desktop/workflow/frontend",
                "Destination": "/app",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "volume",
                "Name": "9a085880e8938e31a5b8d4a66b53700b26d3b279799d614a26e82134dd0f58d5",
                "Source": "/mnt/sda1/var/lib/docker/volumes/9a085880e8938e31a5b8d4a66b53700b26d3b279799d614a26e82134dd0f58d5/_data",
                "Destination": "/app/node_modules",
                "Driver": "local",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ]

Any idea about what i'm doing wrong?

like image 234
Ivor Denham-Dyson Avatar asked Feb 26 '19 18:02

Ivor Denham-Dyson


1 Answers

There are a bunch of related GitHub issues: https://github.com/docker/compose/issues/5212 and https://github.com/moby/moby/issues/34936

Try to update your docker-compose installation (1.21+) and change the value of version directive to at least version "3.3".

like image 169
funnydman Avatar answered Oct 13 '22 00:10

funnydman