![](/img/trans.png)
[英]Running Kafka on Windows 10 fails: The system cannot find the path specified
[英]Docker Windows build fails with error: “The system cannot find the path specified”
我试图在 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,网页浏览告诉我默认的容器基本大小是 10GB)。
尝试通过添加以下 json 在 docker daemon 配置中将大小更改为 20GB:
"storage-opts": [
"size=20G"
]
我遇到了相同的错误消息,尝试了各种故障排除方法,并使用该守护程序设置解决了该问题。
对于 Docker Enterprise,可以在这里配置 C:\\ProgramData\\docker\\config\\daemon.json
"storage-opts":["size=20G"]
如果此文件不存在,则创建它
我无法用其他方法解决这个问题; 对我有用的是删除并重新拉取基本图像。 因此,显然有可能从损坏的图像中获取此错误。
检查项目是否正在运行! 如果它正在运行完成它。 然后再次检查命令
docker for windows 似乎不支持连接和硬链接。
我在尝试使用 Cygwin 创建容器时遇到了类似的问题。 Cygwing 经常使用硬链接。 这一切都在进行,直到 Docker 尝试提交一个映像,但它因“hcsshim::ImportLayer - 找不到路径”错误而失败。 当我摆脱容器中的硬链接时,我能够毫无问题地提交图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.