Can't create a docker image for COPY failed: stat /var/lib/docker/tmp/docker-builder error

前端 未结 18 1909
余生分开走
余生分开走 2020-12-03 00:07

I want to create a docker image. This is my work directory: Dockerfile.in test.json test.py

And this is my Dockerfile:

COPY ./test.json /home/tes         


        
相关标签:
18条回答
  • 2020-12-03 00:44

    In my case, I had to put all my project files into a subdirectory

    app -|inside app directory we have the following
         | package.js
         | src 
         | assets
    Dockerfile
    
    

    Then I copied files in his way

    COPY app ./
    
    0 讨论(0)
  • 2020-12-03 00:45

    I had to use the following command to start the build:

    docker build .

    0 讨论(0)
  • 2020-12-03 00:45

    When using the Docker compose files, publish, publishes to obj/Docker/Publish. When I copied my files there and pointed my Dockerfile to this directory (as generated), it works…

    0 讨论(0)
  • 2020-12-03 00:46

    In your case removing ./ should solve the issue. I had another case wherein I was using a directory from the parent directory and docker can only access files present below the directory where Dockerfile is present so if I have a directory structure /root/dir and Dockerfile /root/dir/Dockerfile

    I cannot copy do the following

    COPY root/src /opt/src
    
    0 讨论(0)
  • 2020-12-03 00:50

    You should put those files into the same directory with Dockerfile.

    0 讨论(0)
  • 2020-12-03 00:51

    I was also facing the same, I moved my docker file to root of the project. then it worked

    0 讨论(0)
提交回复
热议问题