1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > 【docker】——报错:file not found in build context or excluded by .dockerignore

【docker】——报错:file not found in build context or excluded by .dockerignore

时间:2018-09-05 23:47:56

相关推荐

【docker】——报错:file not found in build context or excluded by .dockerignore

1. docker ADD

简介:

采用 ADD 将主机的文件拷贝到要构建的docker镜像的时候,报错:

file not found in build context or excluded by .dockerignore

原因

dockerfile 不能获取 父目录

方案:

将dockerfile放到父目录将文件copy到当前目录

2. ADD之后的文件路径

命令

ADD ./TensorRT-5.1.5.0.Ubuntu-16.04.5.x86_64-gnu.cuda-10.1.cudnn7.5.tar.gz /workspace/TensorRTRUN cd /workspace/TensorRT/TensorRT-5.1.5.0/python \&& pip install tensorrt-5.1.5.0-cp36-none-linux_x86_64.whl

会自动新建 /workspace/TensorRT 文件夹原始的文件夹Tensorrt-5.1.5.0也会存在是压缩文件时,ADD 会自动解压,COPY 不会解压

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。