problem with docker

After installing Docker you are prompted to add your user to the docker group. Simply run the command shown:

sudo usermod -aG docker $USER

You will need to close your session and log in again to have the change take effect.


There are two possible reasons why you get this error:

  1. The Docker daemon is not running. You can check that with sudo /etc/init.d/docker status.

  2. The Docker daemon is running but is configured not to listen on /var/run/docker.sock. You can check in /etc/default/docker if any -H option is specified in DOCKER_OPTS.


Try to reboot your os after docker was installed to apply group permissions, if your user joined docker group..

Update:

When Docker installing on ubuntu 14.04, the installer recomments what your user adds to Docker group to access Docker Service.

Look at

The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can access it with sudo. For this reason, docker daemon always runs as the root user. To avoid having to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.

source: https://docs.docker.com/installation/ubuntulinux/#create-a-docker-group

Tags:

Docker