gpt4 book ai didi

docker - Docker/Docker-Compose 中的 NFS 卷

转载 作者:行者123 更新时间:2023-12-01 03:41:26 25 4
gpt4 key购买 nike

我正在使用 boot2mac 和 docker-compose。我希望能够将其配置为通过 NFS 挂载我的卷。这是我的配置:

web:
image: nginx
links:
- db
ports:
- "80:80"
volumes:
- .:/usr/share/nginx/html
db:
image: postgres

最佳答案

要在撰写文件中定义 nfs 卷,请按照此 thread 中的说明执行操作:

volumes:
name:
driver: local
driver_opts:
type: nfs
o: addr=192.168.1.1,rw
device: ":/path/to/dir"

这是支持的,因为至少 composefile 版本 2

关于docker - Docker/Docker-Compose 中的 NFS 卷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30491449/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com