Docker Login Issues

These are the some of Docker login Issues that we face while working on docker, these are the issues that I have faced, in future if I face any new issues I will post them in the blog, till then follow my blogs to get new things to learn

1). DNS Server Error 

Am working on Docker which is hosted on Ubuntu machine, which I created that machine on oracle virtual box.
So, I have faced docker login issues, while am trying to push my images to Docker Hub. So, the issue is got is with DNS server error, below is the error message that I got.
  • Command: docker login
{ Error saving credentials: error storing credentials - err: exit status 1, out: `Post "https://hub.docker.com/v2/users/login?refresh_token=true": dialing hub.docker.com:443 with direct connection: resolving host hub.docker.com: lookup hub.docker.com on 127.0.0.53:53: server misbehaving` }
  •  The error message indicates that there was a problem resolving the hostname hub.docker.com to an IP address. This could be caused by various factors such as a DNS server issue or a network connectivity problem.
  •  In the error it clearly shows that server is misbehaving with the 127.0.0.53:53 Ip address, that Ip address is my DNS server address that you find this file “resolv.conf” 
  • Command: sudo nano /etc/resolv.conf
  • Go to the above command you will see this DNS server Ip address of our machine, and verify the Ip address that is same or not, if it is same then change use below command to change the DNS server Ip address to google DNS server Ip address
  •  Command: sudo nano /etc/systemd/resolved.conf 
  • Go to this command and edit the data in that file, add the following line under [Resolve] section                                      [Resolve]                                                                                                                                                                                            DNS=8.8.8.8
  •  And save the file and restart the docker “sudo service docker restart”
After this use docker login command to login to docker hub and push your images to docker hub.

2). Error: password store is empty.

{ Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `pass not initialized: exit status 1: Error: password store is empty. Try "pass init".``}

  • By the above error message, it seems like there is an issue with the password store used by Docker to store your login credentials. The error message indicates that the password store is empty and suggests running the "pass init" command to initialize it.
  • To resolve this issue, try running the "pass init" command as suggested by the error message. This command initializes the password store used by Docker to store your login credentials. Once the password store is initialized, you can try logging in again using the "docker login" command.
Here are the steps to run the "pass init" command:
  1. Open a terminal window on your Ubuntu machine.
  2. Type the following command and press Enter:                                                                                                                         Command: pass init
  3. You may be prompted to enter a passphrase to encrypt your password store. Choose a passphrase and enter it when prompted.
  4. After the password store is initialized, try logging in again using the "docker login" command.

  • If it works fine no issues but some may face error like the following then follow the steps given below 
{sampath@sampath-VirtualBox:~/.docker$ pass init
Usage: pass init [--path=subfolder,-p subfolder] gpg-id...}
  • For the pass init command requires one or more GPG keys to be passed as arguments. GPG keys are used to encrypt and decrypt passwords stored in the password store. 
To initialize the password store with your GPG key, you can run the following command:
  1. Command: pass init <gpg-id>
  • If you don't have gpg id follow the below command to install it 
  1. Command: sudo apt-get update
  2. Command: sudo apt-get install gnupg
  • Generate a new GPG key using the gpg command:
  1. Command: gpg --full-generate-key
  • Get the ID of your GPG key by running the following command:
  1. Command: gpg --list-secret-keys --keyid-format LONG
  • Initialize the password store with your GPG key by running the following command:
  1. Command: pass init <gpg-id>
while installing the "gnupg" you will encounter some options that you need to choose so that the installation will continue. here are the settings you need to do while installing 














  • You can select option (1) RSA and RSA as this is the default and most commonly used key type.This option generates a key pair with RSA encryption for both the public and private keys.












  • This prompt is asking how long the GPG key should be valid for. You can set an expiration date for the key or choose to have it never expire. If you want the key to never expire, simply press Enter to select the default value of 0. If you want to set an expiration date for the key, enter the number of days, weeks, months, or years after which the key will expire. For example, to set the key to expire in 1 year, enter 1y and press Enter.
Then give real name and Gmail id and press enter so that key will be generated and then copy the GPG key and  use that key to login to docker hub. 

Comments

Popular Posts