heroku container:login permission denied error troubleshooting question

TLDR: if you have this error go here How can I use docker without sudo? and once you have completed these steps restart your computer.

I am trying to push a project up to heroku. I've recently installed both docker and heroku. I've potentially made mistakes in both installs. If I run docker -v && which docker I get:

Docker version 19.03.2, build 6a30dfca031
/usr/bin/docker

If I recall I installed docker using a community version not docker.io but I'm not sure how to find out which version I installed. Either way, prior to running any docker commands I need to sudo.

I think I need to do the following:

How can I use docker without sudo?

Also, I installed heroku for the first time on this machine and used a snap, which I've never used before. I had to install snaps to my path, but that appears to have been done correctly as heroku login

When I try to use the heroku cli and run heroku container:login I get:

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
Get
dial unix /var/run/docker.sock: connect: permission denied

which is similar to the error I get if I just try to run docker run hello-world without sudo

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:
Post
dial unix /var/run/docker.sock: connect: permission denied.

I "think" what I need to do is edit my docker user permissions so that the heroku cli can interact with docker correctly to run heroku container:login. However, prior to changing permisssions, I'd like to validate that I'm correct that the above link for "How can I use docker without sudo?" will:

  1. fix my problem
  2. not screw this up further

notes: running linux popos 19.10, also have the sudo problem with docker-compose. When I run cat /etc/group | grep 'docker' I get docker:x:128:myusernamehere however, when I run docker run hello-world it fails. I decided to restart, figuring that docker maybe needed to access something with the changed permission group. It worked. Now when I run docker run hello-world without sudo it works.

Solution My intuition was correct that I just needed to add permissions. heroku container:login works as expected now. IMO this questions should be marked as duplicate and deleted.

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like