Tips for working with docker without running `sudo docker -d` on Ubuntu 15.04

After updating my system from 14.10 to 15.04, I can not use docker, as before. I already have a docker group in which my user is part of, and I used to be able to use docker without sudo just fine. Now I can not use it if sudo docker -d does not work for me in another terminal. Simple docker ps execution gives me this error:

FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

I tried reinstalling, rebooting, restarting the services and inflating the configurations to no avail. Any advice would be appreciated. As a side note, I am installing 15.04 on vm to see if I can work as a docker, and I was able to install it without problems. seems to be a problem common to those upgraded from 14.10.

+8
linux docker ubuntu service daemon
source share
3 answers

Have you checked this http://docs.docker.com/articles/systemd/ ? It helped me start the docker under Ubunu 15.04.

+5
source share

What if it fails ...

 $ sudo usermod -aG docker $USER 

... and you added the user to the Docker group, and Ubuntu still requires sudo:

If you initially ran Docker command-line commands using sudo before adding the user to the docker group, you may see the following error, which indicates that your ~/.docker/ was created with incorrect permissions due to sudo commands.

To fix this problem, either delete ~/.docker/ (it ~/.docker/ again automatically, but all user settings are lost), or change its owner and permissions using the following commands:

 $ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R $ sudo chmod g+rwx "$HOME/.docker" -R 
+1
source share

What the mafahand link gives is how to use docker on the systemd host. Ubuntu 15.04 uses systemd now, and the older version is an upstart. This may explain why upgraded systems show erratic behavior. Check out the Ubuntu wiki for some help in this regard.

After installing docker through

 sudo apt install docker.io 

you may need to reboot the system or run the docker.socket module manually. For some reason this did not happen on my machine after it was installed.

Enter

 systemctl status docker 

to check if docker is working. If it is not turned on, use

 sudo systemctl enable docker 

to enable it and / or

 sudo systemctl start docker 

to start the service.

0
source share

All Articles