Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tips on getting docker to work without having to run `sudo docker -d` on Ubuntu 15.04

After upgrading my system from 14.10 to 15.04 I can't seem to use docker like I used to. I already have a docker group that my user is part of and I used to be able to use docker without sudo just fine. Now I can't use it unless I have sudo docker -d running in another terminal. Simply running docker ps 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've tried reinstalling, rebooting, restarting services, and blowing out configurations to no avail. Any tips would be appreciated. As a side note, I installing 15.04 in a vm to see if I could get docker working there and I was able to set it up no problem. seems like an issue specific to those who have upgraded from 14.10.

like image 854
haymez Avatar asked Apr 23 '15 22:04

haymez


2 Answers

Did u checked this http://docs.docker.com/articles/systemd/? This helped me to start docker under Ubunu 15.04.

like image 146
mafahand Avatar answered Oct 27 '22 00:10

mafahand


What to do if this fails...

$ sudo usermod -aG docker $USER

..and you have added user to docker group and Ubuntu still requires sudo:

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

To fix this problem, either remove the ~/.docker/ directory (it is recreated automatically, but any custom settings are lost), or change its ownership and permissions using the following commands:

$ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R

$ sudo chmod g+rwx "$HOME/.docker" -R
like image 44
joe hoeller Avatar answered Oct 26 '22 23:10

joe hoeller