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

前端 未结 18 1995
余生分开走
余生分开走 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 01:05

    The way docker look for file is from the current directory i.e. if your command is

    COPY target/xyz.jar app.jar

    ADD target/xyz.jar app.jar

    The xyz jar should be in the current/target directory - here current is the place where you have your docker file. So if you have docker in a different dir. its better bring to main project directory and have a straight path to the jar being added or copied to the image.

提交回复
热议问题