How to fix docker Got permission denied issue

0 votes

I have ubuntu os with docker installed.

If I run

sudo docker run hello-world

Everything is fine, however I'd like to hide the sudo command to make it shorter.
If I type the command without using sudo like below, it fails.

docker run hello-world

Obviously, I get an error stating I don't have privileges

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.35/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'.

Same happens with this command

docker-compose up

Anyone got any ideas?

May 10, 2022 in Docker by pranav
• 2,590 points

edited 4 days ago 86 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP