You can add a local image registry to Tanzu Mission Control using the command line interface. It can be added in three different ways: (1) credentials in the command line arguments, (2) credentials with Docker config file, and (3) encoded credentials in dockerconfigjson format

Prerequisites

Make sure you have the appropriate permissions to add local image registries.
  • To add local image registries you must be associated with the Tanzu Mission Control role cluster.admin role.
Note: You can use the TMC CLI commands as shown below, or you can use the Tanzu CLI command tanzu mission-control account credential create --input-template image-registry --data-values-file <data_file>.

Procedure

  1. Use the following command to create the local image registry with credentials:
    tmc account credential create --template image-registry --access-id demouser
    --access-secret demopassword --name test-registry --registry-url myregistry.io
    --registry-namespace test-ns
  2. Use the following command to create the local image registry with credentials and CA cert:
    tmc account credential create --template image-registry --access-id demouser
    --access-secret demopassword --name test-registry --registry-url myregistry.io
    --registry-namespace testns --ca-cert="$(cat /tmp/ca.crt)"
  3. Use the following command to create the local image registry with the credentials in dockerconfigjson format:
    tmc account credential create --template image-registry --name test-registry
    --registry-url myregistry.io --registry-namespace testns --dockerconfig-file
    dockerconfig.json

    The dockerconfig.json can contain values like below:

    {
        "auths": {
            "myregistry.io": {
                "auth": "ZGVtb3VzZXI6ZGVtb3Bhc3N3b3Jk",
                "password": "demopassword",
                "username": "demouser"
            }
        }
    }
  4. Use the following command to create the unauthenticated local image registry:
    tmc account credential create --template image-registry --name test-registry
    --registry-url myregistry.io --registry-namespace testns
  5. Use the following command to list image-registry credentials:
    tmc account credential list --capability IMAGE_REGISTRY
  6. Use the following to get specific image-registry credentials:
    tmc account credential get test-registry