Home > Blockchain >  dockerfile stat var/www/html: file does not exist
dockerfile stat var/www/html: file does not exist

Time:07-05

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

CodePudding user response:

Let give you some possible solutions

Use COPY with ./ and also with the file extension

COPY ./file.txt /destination/path

In the case if it is a directory, use ADD

ADD ./file /destination/path

Also make sure not to have file in your .dockerignore

  • Related