Docker Pull Permission Denied Issue-Can't Download Docker Container

Good Day TLK Team,

This is the error message I am getting when I get to the Pulling phase.

alchemistclubstudios@alchemistclubstudios:~$ docker login nvcr.io
WARNING: Error loading config file: /home/alchemistclubstudios/.docker/config.json: stat /home/alchemistclubstudios/.docker/config.json: permission denied
Username: $oauthtoken
Password:
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.39/auth: dial unix /var/run/docker.sock: connect: permission denied

Hi johnnymystic19,
I think you may get the same error when you run below command
$ docker run helloworld

Please run below to fix your issue.

  1. Firstly, check whether there is a user group for docker.
    $ sudo cat /etc/group | grep docker
  2. If not, then create the docker group.
    $ sudo groupadd docker
  3. Add your user to the docker group.
    $ sudo usermod -aG docker $USER
  4. double check
    $ sudo cat /etc/group |grep docker
  5. Restart docker
    $ sudo systemctl restart docker
  6. check below commands again.
    docker run helloworld docker login nvcr.io

Reference: https://docs.docker.com/v17.09/engine/installation/linux/linux-postinstall/#manage-docker-as-a-non-root-user