本文介绍了COPY失败:stat / var / lib / docker / tmp / docker-builder700869788 / private:无此类文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到错误:
我在Dockerfile中写过:
I wrote in Dockerfile:
FROM "centos"
RUN mkdir ~/.ssh
COPY ./private ~/.ssh/id_rsa
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm
RUN yum install -y wget
RUN yum update -y
,当我运行 docker build ./ -t docker / app
时,出现错误:
and when I run docker build ./ -t docker/app
,I got an error:
Status: Downloaded newer image for centos:latest
---> ff426288ea90
Step 2/22 : RUN mkdir ~/.ssh
---> Running in 49d3950mwpion
Removing intermediate container 49d73360f899
---> 24shentufhckm
Step 3/22 : COPY ./private ~/.ssh/id_rsa
COPY failed: stat /var/lib/docker/tmp/docker-builder700869788/private: no such file or directory .
当然,私钥位于我的PC中。现在,此Dockerfile位于myname / Desktop / app / Dockerfile。私有ket位于〜/ .ssh / id_rsa中。此错误是否表示目录错误?
Of course, private key is in my PC.Now this Dockerfile is in myname/Desktop/app/Dockerfile .And private ket is in ~/.ssh/id_rsa .Is this error meaning directory wrong?
推荐答案
文件与Dockerfile放在同一目录中。
You should put the file into the same directory with Dockerfile.
这篇关于COPY失败:stat / var / lib / docker / tmp / docker-builder700869788 / private:无此类文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!