Docker issues I met
Table of Contents
I started to use docker in the past few days, and encountered few issues:
1 Use docker as a non-root user without sudo
I am using debian and installed docker with aptitude
, that created
a new group named docker
, and the unix socket file created by the
docker daemon is owned by that group:
$ ls /run/docker.sock -l srw-rw---- 1 root docker 0 Jul 14 20:46 /run/docker.sock
so just add the user you are using to the group docker
, then you
can easily use docker command without sudo
:
$usermod -a -G docker $newgrp docker # this command make the previous command take effect without logging out/in
You can use -G
option of docker daemon to specify a group rather
than using the default docker
group.
2 Generate layer archive error
When I pushed a docker image to docker hub, it issues:
2014/07/14 09:14:15 Failed to generate layer archive: Error activating devmapper device for '062d727961a00bf89f725160b52af9eb22ec23ba7826172b5333351876e26ef4': Error running DeviceCreate (activateDevice) dm_task_run failed
Restart the daemon and do it again!
3 Hang while pushing images
Shit, docker hub is banned in China, so use a VPN or a proxy please,
I circumvent this by running docker daemon with tsocks
:
$sudo tsocks /etc/init.d/docker.io restart
4 Error: push repository is already in progress
You must killed a hung pushing process :), just restart the docker daemon and push again.
5 Other Errors
Just restart the daemon and do it again! It will solve most problems!