Initial private registry support

Juju now supports private OCI registry.

You are able to host the jujud-operator, juju-db and charm-base OCI images on your own private registry.
In 2.9.13, the initial support for dockerhub was just released.
Other providers are available for testing in 2.9/edge:

Registry Public Private
azurecr.io
docker.io :white_check_mark: :white_check_mark:
ecr.aws
gcr.io :white_check_mark: :white_check_mark:
ghcr.io :x: :white_check_mark:
registry.gitlab.com :x: :white_check_mark:
quay.io :white_check_mark: :white_check_mark:

To bootstrap using a private registry, you just need the registry credential in the following format then set it to controller config caas-image-repo.

  • dockerhub
$ cat credential.json
{
    "repository": "jujuqa",
    "username": "jujuqa",
    "password": "xxx",
}

# or grab the auth token from `~/.docker/config.json`
$ cat credential.json
{
    "auth": "xxxxx==",
    "repository": "jujuqa",
}

$ juju bootstrap microk8s k1 --config caas-image-repo="'$(cat credential.json)'" --debug

Following these steps to set up the credential.

Note: you should use the JSON key but not the short-lived OAuth access token.

# or grab the auth token from `~/.docker/config.json`

$ cat credential.json
{
    "auth": "xxxx==",
    "repository": "gcr.io/<project-id>",
    "serveraddress": "gcr.io"
}

$ juju bootstrap microk8s k1 --config caas-image-repo="'$(cat credential.json)'" --debug


# public registry:
$ juju bootstrap microk8s k1 --config caas-image-repo="gcr.io/<project-id>" --debug

# or
$ juju bootstrap microk8s k1 --config caas-image-repo="'{"repository": "gcr.io/<project-id>"}'" --debug

# docker login with your quay.io username and password
# copy the credential from ~/.docker/config.json
$ cat credential.json
{
    "auth": "xxxx==",
    "repository": "quay.io/juju_qa",
    "serveraddress": "quay.io"
}

$ juju bootstrap microk8s k1 --config caas-image-repo="'$(cat credential.json)'" --debug

# public registry:
$ juju bootstrap microk8s k1 --config caas-image-repo="quay.io/juju_qa" --debug
1 Like

This probably needs to be a part of the proper Juju docs somewhere :slight_smile: Nice work though! @tmihoc @pedroleaoc

2 Likes

Thanks for the alert, @jnsgruk. Added to to-do list for Juju docs.