我想要更改Docker Compose的传播设置。以下是我的YAML文件。
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
然而,当我使用docker-inspect命令检查该容器时,该卷仍然是私有的。
"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": ""
}
]
有什么想法是我做错了什么吗?
docker-compose
版本是什么? - Mostafa Husseindocker-compose --version
的结果,它会给出 docker-compose 的版本。 - Mostafa Hussein