Dockerfile Stat var/www/html:不存在文件
今天,我尝试使用Dockerfile指令来创建新图像。 我的dockerfile
FROM 1275178869/base_image_apache_php_mysql:sjx
COPY file /var/www/html
RUN rm /var/www/html/index.html
EXPOSE 80
运行命令
docker build -t sql:sql .
然后在步骤2中 副本失败了:
COPY failed: file not found in build context or excluded by .dockerignore: stat var/www/html: file does not exist
这意味着我使用的镜像源 ··· 来自1275178869/base_image_apache_php_mysql:sjx ··· 没有路径/var/www/html
Today i trying to ues the Dockerfile instructions to create a new image.
my dockerfile
FROM 1275178869/base_image_apache_php_mysql:sjx
COPY file /var/www/html
RUN rm /var/www/html/index.html
EXPOSE 80
Then I run the command
docker build -t sql:sql .
in step 2
copy failed like:
COPY failed: file not found in build context or excluded by .dockerignore: stat var/www/html: file does not exist
is that mean the mirror source i use
···
FROM 1275178869/base_image_apache_php_mysql:sjx
···
There is no path /var/www/html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让您给您一些可能的解决
方案使用./以及与文件扩展名一起
使用的情况,如果是目录,请使用add
add ./file/dettlain/dattilles/path
也确保不具有 file 在您的.dockerignore中
Let give you some possible solutions
Use COPY with ./ and also with the file extension
In the case if it is a directory, use ADD
ADD ./file /destination/path
Also make sure not to have file in your .dockerignore