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

7,791

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

Share:
7,791

Related videos on Youtube

user357835
Author by

user357835

Updated on September 18, 2022

Comments

  • user357835
    user357835 almost 2 years

    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

    • GracefulRestart
      GracefulRestart about 5 years
      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.