Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Using docker requires sudo #1
Using docker as installed by the docker snap requires sudo. My expectation is that normal users could use docker without needing sudo. This is the case for both the stable and edge versions of the docker snap.
Here's what I found while using the docker snap from
Running docker commands requires sudo to connect to the daemon socket:
Looking at the permissions of the socket indicated in the error message,
Changing the permissions on this socket is enough to allow non-sudo use:
Also you can run docker.help to learn how to configure it.
But if you're running docker under Ubuntu Core 16. It's another story. As system user/group file(etc/passwd, /etc/group) is read-only on UC16. We need new user/group management interface to solve this problem. As of now, we apply a workaround to make docker running without sudo on UC16. The side effect of this is that it requires manual setup to make dockerd running. From the customer feedback, in practical terms, people really hope everything up to work once installation without configuration by hand.
I just encountered this error, and as it was explained to me, the issue is that a user needs to be added to the
I would assume this is still the case and seems like a good method of handling that to me.. but this issue also haven't been commented on in quite a while..
referenced this issue
Jul 8, 2018
so it should be
from a non-snap installed machine, the group is "docker"
The correct way is,
then the group will be "docker"
@ttshaw's method worked for me in both Ubuntu 16.04 and 18.04 (Desktop editions) for the snap way of installing docker. The complete step-by-step method is then:
I did not have any need to log out or reboot computer using above steps.
To verify docker was installed correctly: