Error when docker run build ubuntu 20.04

Ubuntu: 20.04

I dont know why I get err: “error getting credentials - err: exit status 1, out: exit status 2: gpg: decryption failed: No secret key

Event though I was uninstall docker, remove Docker directories, Docker Desktop directories, Docker group, Docker Compose.

- sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli
- sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce
- sudo rm -rf /var/lib/docker
- sudo rm -rf /etc/docker
- sudo rm -rf ~/.docker
- sudo rm -rf /var/lib/docker-desktop
- sudo rm -rf /var/lib/docker-desktop-updater
- sudo groupdel docker
- sudo rm /usr/local/bin/docker-compose

After that I reinstall docker with this steps

- sudo apt-get update
- sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
- sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
- sudo apt-get update
- sudo apt-get install -y docker-ce docker-ce-cli containerd.io
- sudo systemctl start docker
- sudo systemctl enable docker
- sudo apt install ./path/to/docker-desktop.deb (in my case is "docker-desktop-amd64.deb")
- systemctl --user start docker-desktop
- open docker desktop and login by web

I tried solutions in this Error saving credentials: error storing credentials - err: exit status 1, out: `error getting credentials - err: exit status 1, out: `exit status 2: gpg: decryption failed: No secret key`` but still error

What do you want to use? Docker Desktop or Docker CE? You installed both. Docker Desktop requires only adding the APT repository, not installing anything. It will install the cli as a dependency.

If you don’t need Docker CE, delete it or make sure you are using the “desktop-linux” docker context.

docker context use desktop-linux

The forum topic you linked also mentions recreating the gpg key. Here is the documentation you might have missed:

https://docs.docker.com/desktop/get-started/#credentials-management-for-linux-users

I also edited your posts. Please, format your messages according to the following guide: How to format your forum posts

So the spam filter will not block you because of sharing links when you didn’t even wanted to make docker.io a link.

Also avoid using URL shorteners. I almost didn’t click on your link because I saw it is a shortened url and we can’t tell what is behind it. You can find tips for sharing URLs as well in the linked guide. I fixed it for you in your last post.

1 Like

Thanks for reply! Now i’m using Docker CE but I wanna use Docker Desktop.
I dont know why error can resolve, maybe cause cache or anything else.
I stop Docker CE then delete config.json file after that restart docker and login but I need to do that two time. After the first time, I login false then I need restart laptop and do that again. In this time, I must login success.