Docker Compose 构建失败 - 文件共享已取消
Docker Compose failed to build - Filesharing has been cancelled
我 运行 遇到了 Docker 桌面的问题,目前我是 运行 作为 Whosebug 用户的边缘版本。在我通过安装边缘版本 "solved" 得到驱动器因未知原因未共享错误之前:
现在已经安装了这个,我收到了这个阻止构建某些容器的新错误。这些容器都已经过测试,可以在其他几个系统上运行。目前 4 个容器中有 3 个未构建,它们都产生如下相同的错误:
ERROR: for db Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
Encountered errors while bringing up the project.
完全错误:
Creating imt2291-part2_www_1 ...
Creating imt2291-part2_phpmyadmin_1 ... done
Creating imt2291-part2_db_1 ...
Creating imt2291-part2_test_1 ... error
Creating imt2291-part2_www_1 ... error
ERROR: for imt2291-part2_test_1 Cannot create container for service test: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for imt2291-part2_www_1 Cannot create container for service www: status Creating imt2291-part2_db_1 ... error
lled"}
ERROR: for imt2291-part2_db_1 Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for test Cannot create container for service test: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for www Cannot create container for service www: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for db Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
Encountered errors while bringing up the project.
有没有人以前遇到过这个问题并找到了解决办法?
您需要为 Windows 应用程序更新 Docker 中的文件共享配置(2.2.0.0 中有一个新的安全强化,它具有激进的默认设置)。添加您需要的所有文件夹,然后为 Windows 重新启动 Docker。
将“文件共享”更改为 C 驱动器后,它开始在我的 windows 机器上工作。我正在使用 docker 桌面版 2.3.0.3
我遇到过这个问题,我的环境是windows。首先当问题发生时,我偶然发现文件共享路径为 C: ,而我的项目路径在 G: 中,所以命令 docker-compose up 失败,消息是:
docker: Error response from daemon: status code not OK but 500 {"Message":"Unhandled exception: Filesharing has been cancelled"}
我认为文件共享必须包含您的项目路径。因为当我在其他文件路径中设置我的文件共享路径时,它不起作用,但是,我偶然将它设置到我的项目路径所在的路径,docker-compose up do successfully!
我在 Windows 10 中使用 Docker 并且遇到了同样的问题。
Oleg Nenashev 和 Rejoanul Alam 建议的解决方案帮助了我。
将 Docker 文件所在的项目目录或 C:/ 添加到 docker 共享文件夹即可解决问题。
Getting started 中的第 6 步指出:
Shared folders, volumes, and bind mounts
If your project is outside of the Users directory (cd ~), then you need to share the drive or location of the Dockerfile and volume you are using.
If you get runtime errors indicating an application file is not found, a volume mount is denied, or a service cannot start, try enabling file or drive sharing.
Volume mounting requires shared drives for projects that live outside of C:\Users (Windows) or /Users (Mac), and is required for any project on Docker Desktop for Windows that uses Linux containers.
For more information, see File sharing on Docker for Mac, and the general examples on how to Manage data in containers.
If you are using Oracle VirtualBox on an older Windows OS, you might encounter an issue with shared folders as described in this VB trouble ticket. Newer Windows systems meet the requirements for Docker Desktop for Windows and do not need VirtualBox.
我遇到了同样的错误,Oleg Nenashev 和 Rejoanul Alam 的回答帮助我解决了这个错误。
我的任务是在容器之间共享卷。
我有一个网站文件夹,里面有文件 index.html:
打开Docker桌面设置并在文件共享中输入您正在使用的文件夹的地址:
在此之后,在命令提示符下打开此文件夹并添加必要的 Docker 命令:
如果命令正确,并且您认真执行了所有步骤,那么它一定工作正常。
我 运行 遇到了 Docker 桌面的问题,目前我是 运行 作为 Whosebug 用户的边缘版本。在我通过安装边缘版本 "solved" 得到驱动器因未知原因未共享错误之前:
现在已经安装了这个,我收到了这个阻止构建某些容器的新错误。这些容器都已经过测试,可以在其他几个系统上运行。目前 4 个容器中有 3 个未构建,它们都产生如下相同的错误:
ERROR: for db Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
Encountered errors while bringing up the project.
完全错误:
Creating imt2291-part2_www_1 ...
Creating imt2291-part2_phpmyadmin_1 ... done
Creating imt2291-part2_db_1 ...
Creating imt2291-part2_test_1 ... error
Creating imt2291-part2_www_1 ... error
ERROR: for imt2291-part2_test_1 Cannot create container for service test: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for imt2291-part2_www_1 Cannot create container for service www: status Creating imt2291-part2_db_1 ... error
lled"}
ERROR: for imt2291-part2_db_1 Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for test Cannot create container for service test: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for www Cannot create container for service www: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
ERROR: for db Cannot create container for service db: status code not OK but 500: {"Message":"Unhandled exception: Filesharing has been cancelled"}
Encountered errors while bringing up the project.
有没有人以前遇到过这个问题并找到了解决办法?
您需要为 Windows 应用程序更新 Docker 中的文件共享配置(2.2.0.0 中有一个新的安全强化,它具有激进的默认设置)。添加您需要的所有文件夹,然后为 Windows 重新启动 Docker。
将“文件共享”更改为 C 驱动器后,它开始在我的 windows 机器上工作。我正在使用 docker 桌面版 2.3.0.3
我遇到过这个问题,我的环境是windows。首先当问题发生时,我偶然发现文件共享路径为 C: ,而我的项目路径在 G: 中,所以命令 docker-compose up 失败,消息是:
docker: Error response from daemon: status code not OK but 500 {"Message":"Unhandled exception: Filesharing has been cancelled"}
我认为文件共享必须包含您的项目路径。因为当我在其他文件路径中设置我的文件共享路径时,它不起作用,但是,我偶然将它设置到我的项目路径所在的路径,docker-compose up do successfully!
我在 Windows 10 中使用 Docker 并且遇到了同样的问题。
Oleg Nenashev 和 Rejoanul Alam 建议的解决方案帮助了我。
将 Docker 文件所在的项目目录或 C:/ 添加到 docker 共享文件夹即可解决问题。
Getting started 中的第 6 步指出:
Shared folders, volumes, and bind mounts
If your project is outside of the Users directory (cd ~), then you need to share the drive or location of the Dockerfile and volume you are using.
If you get runtime errors indicating an application file is not found, a volume mount is denied, or a service cannot start, try enabling file or drive sharing.
Volume mounting requires shared drives for projects that live outside of C:\Users (Windows) or /Users (Mac), and is required for any project on Docker Desktop for Windows that uses Linux containers.
For more information, see File sharing on Docker for Mac, and the general examples on how to Manage data in containers.
If you are using Oracle VirtualBox on an older Windows OS, you might encounter an issue with shared folders as described in this VB trouble ticket. Newer Windows systems meet the requirements for Docker Desktop for Windows and do not need VirtualBox.
我遇到了同样的错误,Oleg Nenashev 和 Rejoanul Alam 的回答帮助我解决了这个错误。
我的任务是在容器之间共享卷。
我有一个网站文件夹,里面有文件 index.html:
打开Docker桌面设置并在文件共享中输入您正在使用的文件夹的地址:
在此之后,在命令提示符下打开此文件夹并添加必要的 Docker 命令:
如果命令正确,并且您认真执行了所有步骤,那么它一定工作正常。