windows - Docker Windows 构建失败并出现错误 : "The system cannot find the path specified"

标签 windows docker docker-for-windows

我尝试在 Docker Windows 上创建一个目录连接来创建 8.3 。但它失败并出现以下错误消息。

D:\data\docker\sample>docker build -t sample .
Sending build context to Docker daemon  1.272GB
Step 1/4 : FROM microsoft/windowsservercore
 ---> 2cddde20d95d
Step 2/4 : RUN fsutil.exe behavior set disable8dot3 0
 ---> Running in ec6e7cc09ec6
The registry state is now: 0 (Enable 8dot3 name creation on all volumes).
 ---> 53805bc21858
Removing intermediate container ec6e7cc09ec6
Step 3/4 : RUN mklink /J "C:\PROGRA~1" "C:\Program Files"
 ---> Running in 2116f2070e6a
Junction created for C:\PROGRA~1 <<===>> C:\Program Files
re-exec error: exit status 1: output: time="2017-10-03T16:15:54+09:00" level=error msg="hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) layerId=\\?\C:\ProgramData\Docker\windowsfilter\5234d5f7cd7c2669db1818d9227a4be2822eeb72fc30071a495de78cd578b9f3 flavour=1 folder=C:\WINDOWS\TEMP\hcs088640839"
hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) layerId=\\?\C:\ProgramData\Docker\windowsfilter\5234d5f7cd7c2669db1818d9227a4be2822eeb72fc30071a495de78cd578b9f3 flavour=1 folder=C:\WINDOWS\TEMP\hcs088640839

Dockerfile 如下:

FROM microsoft/windowsservercore
RUN fsutil.exe behavior set disable8dot3 0
RUN mklink /J "C:\PROGRA~1" "C:\Program Files"
CMD [ "powershell" ]

如何在 Docker Windows 上创建目录连接?

最佳答案

我猜您的问题实际上与创建目录连接无关(请注意,您的构建确实完成了该步骤),但与超出 docker 容器的基本大小有关(我看到您从 windowsservercore 中提取,大约 10GB,web browsing 告诉我默认容器基本大小为 10GB。

尝试通过添加此 json 在 docker daemon 配置中将大小更改为 20GB:

"storage-opts": [
  "size=20G"
]

daemon config

我遇到了同样的错误消息,尝试了各种故障排除方法,并使用该守护程序设置解决了问题。

关于windows - Docker Windows 构建失败并出现错误 : "The system cannot find the path specified",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46539165/

相关文章:

mysql - 改变 '/var/lib/mysql/' : Permission denied 的所有权

c++ - Windows 中 Paint 事件中的异常和访问冲突

docker - Docker 上的 Vault TLS - 无法验证 127.0.0.1 的证书,因为它不包含任何 IP SAN

java - WildFly - 与尝试解决安全漏洞相关的应用程序部署问题

selenium - Selenium Chromedriver测试在Windows docker容器中失败并带有http请求超时

docker 运行-v : Unable to mount a bind volume : "invalid volume specification"

c# - 如何配置 ToolStripDropdownbutton 大小以匹配父下拉按钮的大小?

Windows/DOS 汇编 - 简单数学

windows - 使用 cygwin 的 Git 存储 https 密码

java - 使用 docker-java 客户端库获取所有容器/图像