Use Docker Images from Private Registry

Login into the registry

On your laptop, you must authenticate with a registry in order to pull a private image:

docker login

When prompted, enter your Docker username and password.

The login process creates or updates a config.json file that holds an authorization token.

View the config.json file:

cat ~/.docker/config.json

The output contains a section similar to this:

{
    "auths": {
        "https://index.docker.io/v1/": {
            "auth": "c3R...zE2"
        }
    }
}

Create the secret

Create the base64 of the docker config.json file:

Now edit the docker-registry-secret.yml file like this:

Now create the secret into kubernetes cluster:

Create a Pod that uses your Secret

Now in your deployment.yml:

Last updated