hello, I am trying to build an image with this docker file:
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
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
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 directorymv 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