Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the Docker registry login files?

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?

like image 739
Spechal Avatar asked Dec 01 '15 05:12

Spechal


People also ask

Where is docker registry stored?

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 .

How do I access 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.

What is stored in docker 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.


2 Answers

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]"
        }
    }
}
like image 63
Spechal Avatar answered Sep 27 '22 20:09

Spechal


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)
like image 38
VonC Avatar answered Sep 27 '22 20:09

VonC