moby: COPY fails intermittently no such file or directory
Description COPY command in Dockerfile fails intermittently with no such file or directory
Steps to reproduce the issue:
- docker build -t dthompson55/mosquitto .
- Dockerfile contains: COPY docker-entrypoint.sh /
- Filesystem contains: -rwxrwxr-x 1 dant dant 30 Oct 3 11:50 docker-entrypoint.sh
Describe the results you received: —> 7be6a723492a Step 5 : COPY docker-entrypoint.sh / stat /var/lib/docker/aufs/mnt/5c714d1adb30f1366a6d12a49bc6529b88cb2887e71cf640a5daa5e989dac4ea/docker-entrypoint.sh: no such file or directory
Describe the results you expected:
I expected it to copy the file into the build context.
Additional information you deem important (e.g. issue happens only occasionally):
The build works a few times, and then fails. Once it fails I can’t get it to work again. If I reinstall everything on a clean ubuntu image then it works again, for a while.
Output of docker version
:
docker version
Client:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 05:33:38 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.1
API version: 1.24
Go version: go1.6.3
Git commit: 23cf638
Built: Thu Aug 18 05:33:38 2016
OS/Arch: linux/amd64
Output of docker info
:
docker info
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 4
Server Version: 1.12.1
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 6
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host null bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-31-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 992.5 MiB
Name: dant-VirtualBox
ID: WMSY:GBWI:IODG:ZZJK:2UVM:HB7D:PRRW:R6HZ:TIFO:6PVL:JANB:EP5N
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: dthompson55
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
127.0.0.0/8
Additional environment details (AWS, VirtualBox, physical, etc.):
VirtualBox running Ubuntu client
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (11 by maintainers)
I hit this as well, restarting the daemon fixed things…
(not that that is an ok fix, but it is a workaround 😃
This also occurs in combination with GitHub, Dockerhub and automated build. Also see this linke Docker Forums link
Also see: #27233
Keep in mind that source paths in
COPY
andADD
Dockerfile instructions are relative to the build context. So if you runThe trailing
.
indicates the current directory; that directory is used as build-context, and sent to the docker daemon to use for the build.What does your local directory look like?
COPY /work/local.txt
looks for a file namedlocal.txt
in the current directory, so if it’s missing, it fails:However, after creating the file;
Building works;