gpt4 book ai didi

nginx - Docker Compose 使用 nginx 的主机路径错误

转载 作者:IT老高 更新时间:2023-10-28 21:19:18 26 4
gpt4 key购买 nike

当我使用主机路径运行 docker-compose up nginx 时出现错误:

ERROR: for nginx Cannot start service nginx: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\"/d/Sites/lfdwveille/app/config/docker/nginx.conf\\" to rootfs \\"/mnt/sda1/var/lib/docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63\\" at \\"/mnt/sda1/var/lib/docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63/etc/nginx/nginx.conf\\" caused \\"not a directory\\"\""

: 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

[31mERROR[0m: Encountered errors while bringing up the project.

文件夹 url 是正确的 :( 不知道为什么 nginx 不想要挂载文件夹,我对 PHP 和 MySQL 没有任何问题。

我的设置:

  • Windows
  • docker-compose v1.9.0
  • docker 1.12

错误日志:

container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\"/d/Sites/lfdwveille/app/config/docker/nginx.conf\\" to rootfs \\"/mnt/sda1/var/lib/docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63\\" at \\"/mnt/sda1/var/lib/docker/aufs/mnt/fce42187ef3ff6bcc0d5acf53a77d2218348a432063e2d5fe00b8ac945578f63/etc/nginx/nginx.conf\\" caused \\"not a directory\\"\""

有人知道吗?

谢谢!

最佳答案

如果您在 Windows 上使用 Docker Machine,则 docker 对您的 Windows 文件系统的访问权限有限。默认情况下,Docker Machine 会尝试自动共享您的 C:\Users (Windows) 目录。

Docker compose - share volume Nginx

关于nginx - Docker Compose 使用 nginx 的主机路径错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42005919/

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