1

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 http://%2Fvar%2Frun%2Fdocker.sock/v1.40/version: 
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 http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: 
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.

0

You must log in to answer this question.

Browse other questions tagged .