我有这个点燃的docker-compose文件:
version: "2"
services:
orthanc:
build: orthanc
restart: unless-stopped
ports: ["${PORT}:8042"]
volumes: ["orthanc-storage:/var/lib/orthanc/db:Z"]
[...]
volumes:
orthanc-storage:
例如,我不明白如何最终定义卷orthanc-storage
来链接C:/tmp
。
有人可以向我解释吗?谢谢。
答案 0 :(得分:1)
默认情况下,使用的驱动程序是本地驱动程序,用于分配卷,并在Linux中/var/lib/docker/volumes/<project_name>_dbdata
的主机上创建卷。不确认它在Windows中指向什么位置。
您可以定义卷以使用不同的驱动程序,并给出指向该卷的路径
version: "2"
services:
orthanc:
build: orthanc
restart: unless-stopped
ports: ["${PORT}:8042"]
volumes: ["orthanc-storage:/var/lib/orthanc/db:Z"]
[...]
volumes:
orthanc-storage:
volumes:
orthanc-storage:
driver_opts:
type: 'none'
o: 'bind'
device: "C:/tmp"