简体   繁体   English

Docker卷挂载Windows容器

[英]Docker volume mount windows container

I am getting the following error while trying to mount a volume in windows docker container. 尝试在Windows docker容器中装入卷时出现以下错误。

===============
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: container 1234567ebcdh encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106)
================

I have mentioned almost all the possible combinations of c:/app in docker file but still getting error while starting the container itself without -v option. 我已经提到了docker文件中c:/app几乎所有可能的组合,但是在没有-v选项的情况下启动容器本身时仍然出错。

-----------
FROM microsoft/windowsservercore
SHELL ["powershell", "-Command"]
WORKDIR /application
COPY . .
VOLUME C:/application
CMD cmd
-----------
  • OS: Windows 10 作业系统:Windows 10
  • Docker: Docker for windows 2.0.0 Docker:适用于Windows 2.0.0的Docker

If you have any idea what went wrong here? 如果您知道这里出了什么问题?

This seems to be followed with docker/for-win issue 676 which includes : 随后出现docker/for-win问题676 ,其中包括

I was also having this exact issue: 我也有这个确切的问题:

 docker: Error response from daemon: container XYZ encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly. (0xc0370106). 

I found 2 solutions for my case: 我发现了两种解决方案:

I was able to successfully build and run the image by reducing the number of layers in the history. 通过减少历史记录中的层数,我能够成功构建并运行该映像。 (For me this number happened to be a max of 37 layers in history.) (If your dockerfile is based on a 2nd dockerfile, you may need to reduce the number of steps in the 2nd dockerfile.) (对我来说,这个数字在历史上最多为37层。)(如果您的dockerfile基于第二个dockerfile,则可能需要减少第二个dockerfile中的步骤数。)

  • How to debug: I was able to debug this by cutting the number of steps in half until the image ran, then re-adding steps until I discovered how many steps the history could have before breaking the image. 如何调试:通过将步骤数减少一​​半,直到运行图像,然后重新添加步骤,直到发现损坏的图像之前历史记录可以执行的步骤,我才能进行调试。
  • I was able to successfully build and run the image without reducing the number of layers by making sure that the root image was a certain version of windowsservercore:1709 (specifically, the 10.0.16299.904_en-us version of 1709, which does not appear to be pull-able anymore; however, it might also work with the latest version of windowsservercore:1709, I haven't tried). 通过确保根映像是Windowsservercore:1709的特定版本(具体来说,是10.709.6292.904_en-us版本1709,该版本似乎不会出现),我能够成功构建和运行映像而不会减少层数。可以再拉;但是,它也可能与最新版本的Windowsservercore:1709一起使用,我没有尝试过)。
    I didn't debug this, I discovered this by blind luck. 我没有调试它,而是靠运气发现了它。

Note: the same issue reports that mounting can be problematic . 注意:同一问题报告说安装可能有问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM