As this is the currently selected answer, I think people should try @Anish Varghese solution below first as it seems to be the easiest. You only need to install the gnupg2 and pass packages:
sudo apt install gnupg2 pass
If it doesn‘t work, then you can try my original solution here:
I had the same issue. bak2trak answer worked, but it saved credentials in clear text. Here‘s the solution if you want to keep them in a password store.
1) Download docker-credential-pass from https://github.com/docker/docker-credential-helpers/releases
tar -xvf docker-credential-pass.tar.gz
chmod u+x docker-credential-pass
mv docker-credential-pass /usr/bin
5) You will need to setup docker-credential-pass (following steps are based of https://github.com/docker/docker-credential-helpers/issues/102#issuecomment-388634452)
5.1) install gpg and pass (
apt-get install gpg pass)
gpg --generate-key, enter your information. You should see something like this:
pub rsa3072 2018-10-07 [SC] [expires: 2020-10-06]
Copy the 123... line
pass init 1234567890ABCDEF1234567890ABCDEF12345678 (paste)
pass insert docker-credential-helpers/docker-pass-initialized-check and set the next password "pass is initialized" (without quotes).
pass show docker-credential-helpers/docker-pass-initialized-check. You should see pass is initialized.
6) create a ~/.docker/config.json with:
7) docker login should now work
Note: If you get the error "pass store is uninitialized" in future run, run the below command (it will reload the pass store in memory):
pass show docker-credential-helpers/docker-pass-initialized-check
It will ask your password and it will initialize the pass store.
This is based off this discussion: https://github.com/moby/moby/issues/25169#issuecomment-431129898