Docker Community Forums

Share and learn in the Docker community.

Cannot copy file into a docker container

(Bpathak) #1

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 server.properties ctr_kafka:/opt/kafka_2.10-0.10.0.1/config/server.properties
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
Plugins:
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:
seccomp
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
ID: PSWZ:L6HG:EKG3:MBMJ:2RR6:BY7G:M3AE:BTFC:FXQK:HRHU:KGRB:5ODT
Docker Root Dir: /mnt/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: true
Product License: Community Engine

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

Any ideas?

Thanks
Bhushan Pathak

(Nitishmowall) #2

hey
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.

#3

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