Php: problem build basic image

Created on 13 May 2021  路  1Comment  路  Source: docker-library/php

hello, I am trying to build an image with this docker file:

FROM php:8.0.6-apache-buster

COPY src/ /var/www/html/

EXPOSE 80

but I have had this error when running this command:

Step 1/3 : FROM php:8.0.6-apache-buster
 ---> 97f22a92e1d1
Step 2/3 : COPY src/ /var/www/html/
COPY failed: file not found in build context or excluded by .dockerignore: stat src/: file does not exist

this is the content of the src folder:
Dockerfile index.php

question

Most helpful comment

The src/ folder you're copying needs to be in the same directory as the Dockerfile (which is the default build context). So you could move the Dockerfile back a directory mv Dockerfile ../

You could also try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum

>All comments

The src/ folder you're copying needs to be in the same directory as the Dockerfile (which is the default build context). So you could move the Dockerfile back a directory mv Dockerfile ../

You could also try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum

Was this page helpful?
0 / 5 - 0 ratings