今天我尝试使用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
给你一些可能的解决方案
对。/和文件扩展名
使用COPYCOPY ./file.txt /destination/path
如果是一个目录,使用添加
ADD ./file/destination/path还要确保没有文件在你的。dockerignore
中