Synchronize the images in your local image registry with their external source.

To avoid having stale images in your local repository, sync images on a daily basis.

Tanzu Mission Control publishes the list of artifacts without registry address. To pull images from Tanzu Mission Control, use the registry address that has been shared for your organization. Note that mirrored images can have a different base path, but the repository name and the image’s SHA256 checksum should be the same.

Prerequisites

Log in with the tanzu CLI.

Make sure you have the appropriate permissions to sync images.
  • To sync images you must be associated with the cluster.admin role in TMC.

Procedure

  1. List the images using the tanzu CLI.
    tanzu mission-control agentartifacts list
  2. Copy the Tanzu Mission Control agent and dependent images to the local registry.
    1. Using Docker:
      > docker pull ${TMC_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a28666fa859a5d09c7a067289d6dff194ee42ab27217fcfa87f15180c
      > docker tag ${TMC_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a28666fa859a5d09c7a067289d6dff194ee42ab27217fcfa87f15180c ${LOCAL_REGISTRY}/extensions/agent-updater/agent-updater
      > docker push ${LOCAL_REGISTRY}/extensions/agent-updater/agent-updater latest
    2. Using Skopeo:
      > skopeo copy \
      docker://${TMC_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a28666fa859a5d09c7a067289d6dff194ee42ab27217fcfa87f15180c \
      docker://${LOCAL_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a28666fa859a5d09c7a067289d6dff194ee42ab27217fcfa87f15180c

      Here is a sample bash script to copy the artifacts listed in the file to local registry using Skopeo:

      #!/bin/bash
      IMAGE_LIST_FILE=images
      TMC_REGISTRY=""
      LOCAL_REGISTRY=""
      LOCAL_REGISTRY_CREDS=""
      while IFS= read -r line
      do
      echo "Copying $line"
      eval "skopeo copy \
      --dest-tls-verify=false \
      --dest-creds $LOCAL_REGISTRY_CREDS \
      docker://$TMC_REGISTRY/$line \
      docker://$LOCAL_REGISTRY/$line"
      done < "$IMAGE_LIST_FILE"
  3. Copy the Tanzu Standard package repository.
    For the Carvel catalog feature, the Tanzu Standard package repository image must be copied to the local registry. You can use the imgpkg tool from Carvel to copy the image and its dependencies. The Tanzu Standard package repository image is available here:
     ${TMC_IMAGE_REGISTRY}/packages/standard/repo:v2.2.0_update.1
    For example
    imgpkg copy -b ${TMC_REGISTRY}/packages/standard/repo:v2.2.0-update.1 --to-repo ${LOCAL_REGISTRY}/packages/standard/repo
    If your local image registry needs authentication, you can provide that using the following variables:
    • IMGPKG_REGISTRY_HOSTNAME_0
    • IMGPKG_REGISTRY_USERNAME_0
    • IMGPKG_REGISTRY_PASSWORD_0