common icon indicating copy to clipboard operation
common copied to clipboard

Login with non-declaritive registry credential is overwriting `auth.json` of the previous credential when using `podman-docker`

Open lslavkov opened this issue 1 year ago • 2 comments

Pasting this issue from the project https://github.com/containers/podman/issues/22400.

Initially when you have already login from registry.fedoraproject.org using podman login then using docker login to the default registry.

Steps to reproduce

  1. Install podman-docker
  2. Follow docker.io's instructions to login a. Create access token b. run docker login -u $USER c. enter token

Describe the results you received

$ podman login -u $USER
Password:
Login Succeeded!
$ cat /run/user/1000/containers/auth.json
{
    "auths": {
	    "registry.fedoraproject.org": {
		    "auth": "cGF0cmljazpkY2tyX3BhdF84X2xvbHRoaXNhaW50cmVhbAo="
       }
    }
}
$ docker push $USER/$IMAGE
[...]
Error: writing blob: initiating layer upload to /v2/$USER/$IMAGE/blobs/uploads/ in registry-1.docker.io: requested access to the resource is denied

Describe the results you expected

$ docker login -u $USER
Password: 
Login Succeeded!
$ cat /run/user/1000/containers/auth.json
{
    "auths": {
	    "registry-1.docker.io": {
		    "auth": "cGF0cmljazpkY2tyX3BhdF84X2xvbHRoaXNhaW50cmVhbAo="
	    }
    }
}⏎
$ docker push $USER/$IMAGE
Writing manifest to image destination

^ exit success

or

Failure for the login command

lslavkov avatar Feb 03 '25 08:02 lslavkov