Gpg error on docker login and docker build

Hello, I was trying to learn docker, I am using arch linux, and I followed the tutorial successfully and built my first docker image and container. Though, after that I logged in by generating a key with gpg --gen-key and initializing a password store, and then docker login worked. But after that when I try to build an image I get this error

ERROR: failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1: error getting credentials - err: exit status 1, out: error getting credentials - err: exit status 1, out: exit status 2: gpg: public key decryption failed: No such file or directory
gpg: decryption failed: No such file or directory``

I reboot and nothing changes, (I did this because some people were saying that a reboot may fix it on stack overflow)

Also now when I login I get a very similar error like this:

Error saving credentials: error storing credentials - err: exit status 1, out: error getting credentials - err: exit status 1, out: exit status 2: gpg: public key decryption failed: No such file or directory
gpg: decryption failed: No such file or directory``