我正在Windows 10 64bit下使用Docker Toolbox 1803。
我正在尝试在本地系统中运行code,但是在Toolbox GuickStart Terminal中运行以下命令时却失败了。
docker-compose -f docker-compose.yml -f docker-compose-cassandra.yml up
以下docker-compose.yml行导致了此问题。
version: '2'
...
prometheus:
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
失败信息如下:
ERROR: for 80b791289250_prometheus Cannot start service prometheus: b'OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \\"rootfs_linux.go:58: mounting \\\\\\"/e/FreelanceProjects/myapp/docker-zipkin/prometheus/prometheus.yml\\\\\\" to rootfs \\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/277f74637f71455a7b1ab4e421cf629b926f3bcbe216c3e109e029c49502b5a1\\\\\\" at \\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/277f74637f71455a7b1ab4e421cf629b926f3bcbe216c3e109e029c49502b5a1/etc/prometheus/prometheus.yml\\\\\\" caused \\\\\\"not a directory\\\\\\"\\"":Starting zipkin ... done
if the specified host path exists and is the expected type'
ERROR: for prometheus Cannot start service prometheus: b'OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \\"rootfs_linux.go:58: mounting \\\\\\"/e/FreelanceProjects/myapp/docker-zipkin/prometheus/prometheus.yml\\\\\\" to rootfs \\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/277f74637f71455a7b1ab4e421cf629b926f3bcbe216c3e109e029c49502b5a1\\\\\\" at \\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/277f74637f71455a7b1ab4e421cf629b926f3bcbe216c3e109e029c49502b5a1/etc/prometheus/prometheus.yml\\\\\\" caused \\\\\\"not a directory\\\\\\"\\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type'
ERROR: Encountered errors while bringing up the project.
更新:我已设置环境变量COMPOSE_CONVERT_WINDOWS_PATHS=1
,但仍然无法正常工作。