InDockerfileUnder the current directory, when using the build command to build a mirror
docker build --rm -t image-name .
ADD failed: stat /var/lib/docker/tmp/docker-builder055888630/install/xxx.zip: no such file or directory
The directory structure is like this:
. ├── Dockerfile └── install └── xxx.zip
DockerfileThe content of the document is also relatively simple:
FROM openjdk:8u131-jre-alpine ADD install/xxx.zip /opt/ ...
windowsThere is no problem in executing the ADD command in this way. now switch to
UbantuOnly in the past have such problems been discovered. . .
Docker version 17.09.0-ce
I also checked it on the internet and found similar problems.
.dockerignoreFile, Command Designation
-fParameters. . .
All these have been tried, but they are useless. . .
Move the answer, there are probably the following solutions
If you want to add/copy, the file must be in the same root directory as the Dockerfile.
Context can be set
version: '3.3' services: yourservice: build: context: ./ dockerfile: ./docker/yourservice/Dockerfile