标签 no such file or directory 下的文章

错误提示: COPY failed: stat /var/lib/docker/tmp/docker-builder...no such file or directory

具体错误如下:

Step 4/5 : COPY /bin/Release/netcoreapp3.1/publish .
COPY failed: stat /var/lib/docker/tmp/docker-builder255452545/bin/Release/netcoreapp3.1/publish: no such file or directory

解决方案

看到此类错误,需要排查文件或文件夹名称是否有写错,如果一切正确,还需要查看是否配置了.dockerignore文件,并且要COPY的文件夹是否添加到了Ignore列表中,如果有,删除即可。