我正在使用 boot2mac 和 docker-compose。我希望能够将其配置为通过 NFS 挂载我的卷。这是我的配置:
web:
image: nginx
links:
- db
ports:
- "80:80"
volumes:
- .:/usr/share/nginx/html
db:
image: postgres
最佳答案
要在 compose 文件中定义 nfs 卷,请按照此 thread 中的说明执行操作:
volumes:
name:
driver: local
driver_opts:
type: nfs
o: addr=192.168.1.1,rw
device: ":/path/to/dir"
这是支持的,因为至少 composefile 版本 2