I installed Docker on Ubuntu 15.04 using:
wget -qO- https://get.docker.com/ | sh
as described at Install Docker on Ubuntu.
I added myself to the docker group:
sudo usermod -aG docker balaaman
Then I logged out and logged in again, and ran:
docker run hello-world
and saw this:
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
When I tried to start the Docker daemon like this:
sudo service docker start
I got this error:
Failed to start docker.service: Unit docker.service is masked.
Thanks to Yannick Lizzi on this thread I found this fix:
systemctl unmask docker.service systemctl unmask docker.socket systemctl start docker.service
After this, I logged out and logged in again (again) and “docker run hello-world” worked fine, and all was well.
You may want to consider updating this blog post to mention that the user will need to re-authenticate their session to pick up the changes if they cannot simply use the docker command without sudo, after making the aforementioned changes.
That is all, thank you.
Thanks Nicholas – I mentioned logging out and logging in again earlier (after the usermod command) – do you need to do it again after the systemctl commands? I don’t think I needed to…
Thank you.
it worked!!
and very clearly described, thanks!
Thank you very much, help appreciated :D
Glad it helped :-)
“do you need to do it again after the systemctl commands?”
Yes, you need ;)
And teras and teras of thanks for your post Andy Balaam.
Thanks, updated!
Perfeito!!
Did not help. Still masked.