Just to add another solution taking from the other answers here.
If you've already started Docker Desktop and you're seeing the error:
error storing credentials - err: exit status 1, out: `error getting credentials - err: exit status 1
Stop the application:
systemctl --user stop docker-desktop
If you've already followed the steps in credentials-management-for-linux-users , delete the existing pass key:
rm -rf ~/.password-store/docker-credential-helpers
Generate a new key and provide the correct credentials:
gpg --generate-key
Note: make sure you set the correct email in the passkey you use to login into DockerHub. I used the wrong one, which was why Docker Desktop threw the error.
This will print out text like:
pub rsa3072 2023-06-13 [SC] [expires: 2025-06-12]
9F53995439D023FD
uid Your Name <Your Email>
sub rsa3072 2023-06-13 [E] [expires: 2025-06-12]
Then use the gpd-id
displayed within the pub
section to initialise pass
, e.g.:
pass init 9F53995439D023FD
Finally, start Docker Desktop:
systemctl --user start docker-desktop
Hope this helps!
UPDATE: I also ran into problems logging into AWS ECR on Ubuntu with the error:
Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `exit status 1: gpg: public key of ultimately trusted key 9F53995439D023FD not found
gpg: public key of ultimately trusted key 7F525559F4750A05 not found
gpg: public key of ultimately trusted key 3D39C9F57C3C2E11 not found
gpg: public key of ultimately trusted key DCB9A14562B73138 not found
gpg: public key of ultimately trusted key 91B3075B62503284 not found
Password encryption aborted.``
I was able to fix the issue and login to ECR by following the steps in this gist. I'll reproduce them below in case the gist is deleted in the future:
#!/bin/bash
gpg --check-trustdb 2>&1| grep 'not found' | awk '{print $8}' >bad-keys.txt
gpg --export-ownertrust > ownertrust-gpg.txt
mv ~/.gnupg/trustdb.gpg ~/.gnupg/trustdb.gpg-broken
for KEY in `cat bad-keys.txt` ; do sed -i "/$KEY/d" ownertrust-gpg.txt ; done
gpg --import-ownertrust ownertrust-gpg.txt
rm bad-keys.txt ownertrust-gpg.txt
rm -rf ~/.password-store/docker-credential-helpers
to reset things and get it to work. – Flauntgpg --generate-key
and thenpass init "<user-id>"
and thendocker login
should work. This at least works for me on Ubuntu 22.04. – Lomaxapt
everything worked. – Astridastride