It is recommended that syncing of images be done 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 org. Note that mirrored images can have a different base path, but the repository name and the image’s SHA256 should be the same.
Prerequisites
Log in to the Tanzu Mission Control console.
Make sure you have the appropriate permissions to sync images.
- To sync images you must be associated with the Tanzu Mission Control role cluster.admin role.
Procedure
- List the images using the TMC CLI or the Tanzu CLI.
Using the Tanzu CLI:
tanzu mission-control agentartifacts list
Using the TMC CLI:
tmc agentartifacts list
- Copy Tanzu Mission Control agent and dependent images to the local registry.
- Using Docker:
> docker pull
${TMC_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a28666fa859a5d
09c7a067289d6dff194ee42ab27217fcfa87f15180c
> docker tag \
${TMC_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a28666fa859a5d
09c7a067289d6dff194ee42ab27217fcfa87f15180c \
${LOCAL_REGISTRY}/extensions/agent-updater/agent-updater
> docker push ${LOCAL_REGISTRY}/extensions/agent-updater/agent-updater latest
- Using Skopeo:
> skopeo copy \
docker://${TMC_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a2866
6fa859a5d09c7a067289d6dff194ee42ab27217fcfa87f15180c \
docker://${LOCAL_REGISTRY}/extensions/agent-updater/agent-updater@sha256:1a95482a28
666fa859a5d09c7a067289d6dff194ee42ab27217fcfa87f15180c
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"
- Copy the Tanzu Standard Package Repository:
For the Carvel catalog feature, the Tanzu Standard Package Repository image needs to be copied in the local registry. This image should be copied using the imgpkg
tool by Carvel to copy all the dependencies. The Tanzu Standard Repo Image is available here: ${TMC_IMAGE_REGISTRY}/packages/standard/repo:v2.2.0_update.1
> imgpkg copy \
-b ${TMC_REGISTRY}/packages/standard/repo:v2.2.0-update.1 --to-repo
${LOCAL_REGISTRY}/packages/standard/repo
Note - If local registry needs authentication, it should be provided using env
variables
export IMGPKG_REGISTRY_HOSTNAME_0=""
export IMGPKG_REGISTRY_USERNAME_0=""
export IMGPKG_REGISTRY_PASSWORD_0=""