Docker Community Forums

Share and learn in the Docker community.

Cannot copy file into a docker container

I have docker container running on CentOS 7. I need to copy some files to the container, but when I use the docker cp command, I get the following error -

$ docker cp ctr_kafka:/opt/kafka_2.10-
Error response from daemon: no space left on device

The journalctl has the following message -

May 15 13:48:58 localhost dockerd[9902]: time=“2019-05-15T13:48:58.414938284Z” level=error msg=“Handler for HEAD /v1.39/containers/ctr_kafka/archive returned error: no space left on device”
May 15 13:48:59 localhost dockerd[9902]: time=“2019-05-15T13:48:59.707464989Z” level=error msg=“Handler for PUT /v1.39/containers/ctr_kafka/archive returned error: no space left on device”

I have verified that there is enough free disk space available [34% is in use, rest is free, more than 18GB]. The inodes are also free.

$ docker info
Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 3
Server Version: 18.09.3
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
Profile: default
Kernel Version: 4.9.37-29.el7.10212018.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 23.4GiB
Name: localhost
Docker Root Dir: /mnt/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Experimental: false
Insecure Registries:
Live Restore Enabled: true
Product License: Community Engine

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Any ideas?

Bhushan Pathak

from journalctl it clear your container don’t have enough space.
please check what is your docker storage path and then check the capacity of that folder( you can use df -h to check).
And one workaround is to remove the unwanted containers, images, and volumes to free up space.

We are facing the same issue with our php web services, Thanks for sharing this post.