I tried a lot of things to fix this, but nothing worked.
(main) mrakgr@Marko:~/inference-servers$ docker login
Authenticating with existing credentials... [Username: mrakgr]
i Info → To login with a different account, run 'docker logout' followed by 'docker login'
Login Succeeded
(main) mrakgr@Marko:~/inference-servers$ sudo docker push mrakgr/marko-dockerhub:kurrentdb-proxy-e467d2b8
The push refers to repository [docker.io/mrakgr/marko-dockerhub]
ed9d190d74a2: Waiting
2e110dc9ebb3: Waiting
1adb6524f9b3: Waiting
3da95a905ed5: Waiting
dcec590fde93: Waiting
e0b12ada17c2: Waiting
40141a9d5c51: Waiting
6ad6d2d13287: Waiting
cf2944d5c18c: Waiting
push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
If I do it outside of WSL…
PS C:\Users\mrakg> docker login
Authenticating with existing credentials... [Username: mrakgr]
i Info → To login with a different account, run 'docker logout' followed by 'docker login'
Login Succeeded
PS C:\Users\mrakg> docker push mrakgr/marko-dockerhub:kurrentdb-proxy-e467d2b8
The push refers to repository [docker.io/mrakgr/marko-dockerhub]
ed9d190d74a2: Already exists
3da95a905ed5: Layer already exists
dcec590fde93: Layer already exists
1adb6524f9b3: Layer already exists
cf2944d5c18c: Layer already exists
2e110dc9ebb3: Layer already exists
40141a9d5c51: Layer already exists
6ad6d2d13287: Layer already exists
e0b12ada17c2: Layer already exists
kurrentdb-proxy-e467d2b8: digest: sha256:13a2a997024fe022f01ccd57aa7a3ca51bc066168c4bd09c96db6749fb24be87 size: 856
If I really want to push it in WSL, it’s possible to do it using the VS Code extension, but I want to get this to work in makefiles, so I am asking here.
It seems sudo docker login and docker login are completely separate commands. This was a dumb mistake.
(main) mrakgr@Marko:~/inference-servers/icf-optimizer$ sudo docker login
USING WEB-BASED LOGIN
i Info → To sign in with credentials on the command line, use 'docker login -u <username>'
Your one-time device confirmation code is: KLQX-DFHL
Press ENTER to open your browser or submit your device code here: https://login.docker.com/activate
Waiting for authentication in the browser…
WARNING! Your credentials are stored unencrypted in '/root/.docker/config.json'.
Configure a credential helper to remove this warning. See
https://docs.docker.com/go/credential-store/
Login Succeeded
(main) mrakgr@Marko:~/inference-servers/icf-optimizer$ sudo docker push mrakgr/marko-dockerhub:kurrentdb-proxy-e467d2b8
The push refers to repository [docker.io/mrakgr/marko-dockerhub]
1adb6524f9b3: Layer already exists
6ad6d2d13287: Layer already exists
cf2944d5c18c: Layer already exists
dcec590fde93: Layer already exists
e0b12ada17c2: Layer already exists
ed9d190d74a2: Already exists
2e110dc9ebb3: Layer already exists
40141a9d5c51: Layer already exists
3da95a905ed5: Layer already exists
kurrentdb-proxy-e467d2b8: digest: sha256:13a2a997024fe022f01ccd57aa7a3ca51bc066168c4bd09c96db6749fb24be87 size: 856
I assume you installed Docker Desktop on Windows and also Docker CE inside WSL. Then Docker Desktop will be used when you run the docker command as your user, but it could use Docker CE (the daemon running inside your distribution directly) when you use sudo to run the command as root, not as your user. The root user will not have the desktop-linux context.