I am switching Macs and don't remember my Docker registry login. I could go in and reset it all, but I would rather copy the hashed login files to the new Mac.
Where are the docker registry credentials stored locally on OSX, Linux and Windows?
The Docker Registry configuration is defined inside of /etc/registry/config. yml . With the default configuration the registry listens on ports 5000 and stores the Docker images under /var/lib/docker-registry .
Sign in to your Docker Hub account as an organization owner. Select an organization and then navigate to the Settings tab on the Organizations page and select Registry Access. Toggle on Registry Access Management to set the permissions for your registry.
A Docker registry is a storage and distribution system for named Docker images. The same image might have multiple different versions, identified by their tags. A Docker registry is organized into Docker repositories , where a repository holds all the versions of a specific image.
I was able to find the information I needed in ~/.docker/config.json
Copying this file from one OSX install to another let me authenticate with the registry without requesting credentials again.
The file looks as such:
{
"auths": {
"registry.domain.com": {
"auth": "HASH_HERE",
"email": "[email protected]"
}
}
}
If you have stuck with the native docker registry V2 (publicatin) authentication, look for a auth/htpasswd
(or just htpasswd
) file that was used to docker run
the registry.
On Windows or Mac, that file would have been created within the VM, possible under /c/Users/...
or /Users/...
, as those are the persistent folders mounted by the boot2docker image.
As the OP spechal comments, the login itself is saved in ~/.docker/config.json
.
This issue for instance illustrates it:
WARNING: login credentials saved in /var/lib/jenkins/.docker/config.json
Login Succeeded
pushing docker image 0fd658e25fd8 from 06bdc8f-1508171450 to docker-registry.tld:5043/repo/ingest_preview:06bdc8f-1508171450
The push refers to a repository [docker-registry.tld:5043/repo/ingest_preview] (len: 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With