1

When I run this command docker build -t hello-world .

I got this kind of error...what should I do...How to copy file to /var/www/html/

Sending build context to Docker daemon 2.048kB

Step 1/3 : FROM php:7.2-apache ---> f046c4ead123

Step 2/3 : COPY src/ /var/www/html/

COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder006125699/src: no such file or directory

  • Your Dockerfile is unable to find the src/ relative path you set in the COPY command. Since you wrote a relative path, that path is relative to the location of the Dockerfile. Since you are building against . (your current working directory, which appears to be /mnt/sda1/var/lib/docker/tmp/docker-builder006125699), you should have a src/ dir, if not that error will occur. – GracefulRestart Jun 14 at 16:39
1

I don’t see any problems with your copy command. Verify that etc actually exists in your working directory: ‘ls -la $(pwd) src/‘ before the docker build command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.