moby: Docker build cannot COPY the file to `/` directory

Dear all,

I’m running docker inside an ubuntu (16.04) VM (vmware player), here is my docker version

Client:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 22:11:10 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 22:11:10 2016
 OS/Arch:      linux/amd64

the output of docker info

Containers: 11
 Running: 1
 Paused: 0
 Stopped: 10
Images: 161
Server Version: 1.12.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 85
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-34-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.66 GiB
Name: ubuntu
ID: NAWG:CZGX:MIW2:B6XJ:FBKQ:5FCP:UP6W:JWLO:R63J:ZUSC:D4Y7:3VXJ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 127.0.0.0/8

I have a simple Dockerfile

FROM alpine:3.4
COPY start.sh /

the start.sh is inside same folder as Dockerfile

when docker build, it shows:

Step 1 : FROM alpine:3.4
 ---> 4e38e38c8ce0
Step 2 : COPY start.sh /
stat /var/lib/docker/aufs/mnt/6379713235a0e7c418874544c96e44a92a142955b78251e8ccb8145b760db7ed/start.sh: no such file or directory

it worked before, while after installing docker-machine and virtualbox, it doesn’t work, don’t know if it related or not. Any idea, thank you in advance.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 42 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I’m running into this exact issue:

Sending build context to Docker daemon 23.42 MB
Step 1 : FROM debian:jessie
 ---> 031143c1c662
Step 2 : COPY busybox /var/
 ---> 520b29bd5bb8
Removing intermediate container fe7af2ed4401
Step 3 : COPY busybox /
stat /var/lib/docker/aufs/mnt/b1dbf331f8bfd73770d946c06adc4d51670282559fe2364a7f7fe880516afffc/busybox: no such file or directory

Is latest Docker just f*ed up? Do we know which versions are affected?

I believe I was having this same problem and specifying the full path for the destination fixed it for me. For example changing:

COPY api api

to:

COPY api /api

did the trick

Same problem for me on Xubuntu 16.04. Fixed with sudo systemctl restart docker.

@thaJeztah this issue can appear on overlay driver as well.