docker push : authorization failed

2023. 6. 8. 10:18Infra/Docker

Dockerfile을 사용해 새로운 이미지를 생성하고 Dockerhub Repository에 이미지를 Push 하려니 아래와 같은 에러가 발생했습니다.

D:\Workspace\Postgres\Dockerfile>docker push xxxxx/postgres:15.3
969a431fe6ee: Waiting
e7787c9e6548: Waiting
f03b40093957: Waiting
5ea6efaf51f6: Waiting
5d48fbe991ff: Waiting
15b4be0dc097: Waiting
9d72f84fb861: Waiting
14cf26be478a: Waiting
75073e0a005c: Waiting
5d52569da92e: Waiting
078b0dfe0eaf: Waiting
9d674c93414d: Waiting
b078d5f4ac82: Waiting
5a6bf2f43fb8: Waiting
f1a40e88fea4: Waiting
4ae692d11ad3: Waiting
c22a90168ede: Waiting
493eb05d0d46: Waiting
b8ef8a478668: Waiting
647b9679860f: Waiting
de781e8e259a: Waiting
97f84fb2a918: Waiting
4be673794a1a: Waiting
3516d6aa5865: Waiting
server message: insufficient_scope: authorization failed

현재 저는 Windows 11에 docker desktop을 사용하고 있습니다.

docker desktop에서 로그인도 잘 되어 있습니다.

해결책

어떠한 원인인지 모르지만 docker desktop에서는 로그인이 되어 있지만 docker hub에는 로그인이 풀려있는 것으로 보입니다.

그래서 콘솔에서 다시 로그인을 진행합니다.

D:\Workspace\Postgres\Dockerfile>docker login
Authenticating with existing credentials...
Login Succeeded

Logging in with your password grants your terminal complete access to your account.
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/

로그인이 다시 되는 것을 볼 수 있습니다.

D:\Workspace\Postgres\Dockerfile>docker push xxxxxx/postgres:15.3
f1a40e88fea4: Pushed
969a431fe6ee: Pushed
c22a90168ede: Pushed
75073e0a005c: Pushed
647b9679860f: Pushed
f03b40093957: Pushed
b078d5f4ac82: Pushed
5a6bf2f43fb8: Pushed
e7787c9e6548: Pushed
078b0dfe0eaf: Pushed
9d674c93414d: Pushed
5ea6efaf51f6: Pushed
4be673794a1a: Pushed
5d48fbe991ff: Pushed
4ae692d11ad3: Pushed
b8ef8a478668: Pushed
de781e8e259a: Pushed
97f84fb2a918: Pushed
9d72f84fb861: Pushed
5d52569da92e: Pushed
15b4be0dc097: Pushed
14cf26be478a: Pushed
493eb05d0d46: Pushed
3516d6aa5865: Pushed
15.3: digest: sha256:3516d6aa5865107b7b5b14dd4976f3d963016e2234abbbc94651403a8e36e773, size: 4909

push도 다시 정상적으로 동작합니다!