(Docker)错误:docker-php-source:构建docker文件时没有这样的文件或目录 [英] (Docker) Getting error: docker-php-source: no such file or directory when building docker file
问题描述
当我尝试在以下位置构建docker文件时: https ://github.com/docker-library/php/blob/3f43309a0d5a427f54dc885e0812068eeeecc03e/7.1/Dockerfile
When I'm trying to build the docker file at: https://github.com/docker-library/php/blob/3f43309a0d5a427f54dc885e0812068ee767c03e/7.1/Dockerfile
命令: docker build- t php_image。
我遇到了以下错误:
Step 14 : COPY docker-php-source /usr/local/bin/
lstat docker-php-source: no such file or directory
有人可以帮我找出这里的错误吗?
Could anybody help me to figure out something wrong here?
谢谢
推荐答案
您没有docker构建的正确上下文。
You don't have the proper context of the docker build.
仅克隆,以确保拥有所有文件(及其正确的权限):
Just clone the repo to be sure to have all the files (and its right permissions):
git clone https://github.com/docker-library/php
docker build . -t php_image
但是如果您需要自定义该映像,则基于以下内容创建自己的Dockerfile会更容易官方版本:
But if you need to customize that image, it's easier to make your own Dockerfile based on the official build:
FROM php:7
RUN #your commands
RUN ...
这篇关于(Docker)错误:docker-php-source:构建docker文件时没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!