ImportLayer failed in Win32: The system cannot find the path specified

ImportLayer failed in Win32: The system cannot find the path specified

近來,我們的 Docker Build 主機上經常過一段時間就會出現以下的錯誤造成 docker build 失敗。

re-exec error: exit status 1: output: time="2020-04-24T12:06:11+08:00" level=error msg="hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) path=\\\\?\\D:\\docker\\windowsfilter\\491cb6193ea952e8e2d178197d19f2d25dd74e86d808de8f6a4a6080d334960e folder=D:\\docker\\tmp\\hcs738100895" 

hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) path=\\?\D:\docker\windowsfilter\491cb6193ea952e8e2d178197d19f2d25dd74e86d808de8f6a4a6080d334960e folder=D:\docker\tmp\hcs738100895 

##[error]C:\Program Files\docker\docker.exe failed with return code: 1

找到兩個2017年與2018年的 #32828#37821 Issue 討論,但沒什麼結論。我們的是最新的 Windows Server 2019 v1909 + Docker Engine 19.x 一樣會出現這樣的問題。多方嘗試後,找到一個很怪的解決辦法:

docker rmi $(docker images --filter "dangling=true" -q)

對,把 dangling=true 的狀態的 images 給清除後,錯誤自動不見,建置立即復工立馬生效。缺點,您要定時清,不然過一陣子錯誤就會又出現。

猜測是我們 Docker Build 的 Host 的配置的硬碟太小(可用約 20GB),Build 產生的暫存檔太多,造成空間被用光了。不過暫存檔並無反應在 Free Disk 的數字上。所以也只能這樣用猜的。

沒有留言:

張貼留言

感謝您的留言,如果我的文章你喜歡或對你有幫助,按個「讚」或「分享」它,我會很高興的。