Debian – Docker hello world gives ‘no space left on device’

cgroupdebiandocker

The command docker run hello-world gives me this error:
System error: write /dev/cgroup/docker/<hash>/cgroup.procs: no space left on device

It's a Debian Wheezy, with a 3.16 kernel from backports. (previously upgraded from squeeze)

/dev is mounted as devtmpfs of 10MB udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=1019797,mode=755)

Does docker have a config option I need to change?

Full output:

$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world 
535020c3e8ad: Pull complete 
af340544ed62: Already exists 
library/hello-world:latest: The image you are pulling has been verified.
Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:d5fbd996e6562438f7ea5389d7da867fe58e04d581810e230df4cc073271ea52
Status: Downloaded newer image for hello-world:latest
WARNING: Your kernel does not support memory swappiness capabilities, memory swappiness discarded.
Error response from daemon: Cannot start container 0ecfcae485a362fffcbf40e26db61356be62a8093f8bcea5dc37147f1a5a47e0: [8]     System error: write /dev/cgroup/docker/0ecfcae485a362fffcbf40e26db61356be62a8093f8bcea5dc37147f1a5a47e0/cgroup.procs: no space left on 

Docker info:

docker info
Containers: 7
Images: 5
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 19
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.16.0-0.bpo.4-amd64
Operating System: Debian GNU/Linux 7 (wheezy)
CPUs: 8
Total Memory: 7.796 GiB
Name: ...
ID: WZ7K:E5CI:YYXJ:GXL6:Q2NL:5S27:NL4T:6KMM:Z4PF:4N56:PZI3:NPMY
WARNING: No memory limit support
WARNING: No swap limit support

df:

Filesystem              Type      Size  Used Avail Use% Mounted on
rootfs                  rootfs    107G   41G   64G  39% /
udev                    devtmpfs   10M     0   10M   0% /dev
tmpfs                   tmpfs     799M  244K  799M   1% /run
/dev/disk/by-label/\x2f ext3      107G   41G   64G  39% /
tmpfs                   tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs                   tmpfs     2.4G     0  2.4G   0% /run/shm
/dev/sda1               ext3       88M   51M   33M  61% /boot
cgroup                  tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/disk/by-label/\x2f ext3      107G   41G   64G  39% /var/lib/docker/aufs

Best Answer

Add cgroup_enable=memory swapaccount=1 to your grub and reboot the OS.

$ sudo vim /etc/default/grub

GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

$ sudo update-grub

$ sudo reboot

Reference