Skip to main content

Mirror Images

Mirrors Witboost Docker images from the source registry to a target registry. This command automatically extracts the list of images to mirror from a specific witboost version, and mirrors them in the specified target registry.

In skopeo mode, any image whose direct registry-to-registry copy fails is automatically retried via local passthrough — pulled to a local directory first, then pushed to the target.

Prerequisites​

  • The CLI has internet access, this is mandatory to reach the Witboost registry
  • The CLI has been initialized (i.e. witboost init)

Mirror Mode Prerequisites​

Skopeo Mode (default)

Docker Mode (fallback)

  • Docker must be installed and running

Usage​

witboost-infra mirror-images --witboost-version <version> --target <registry>

Required Options​

OptionDescription
--witboost-version <string>Witboost version to mirror
--target <string>Target registry URL (e.g., registry.company.com)

Optional Options​

OptionDescriptionDefault
--mode <string>Mirror mode: skopeo (default) or dockerskopeo
--target-username <string>Target registry usernameNone
--target-password <string>Target registry passwordNone
--prefix <string>Image prefix for target registryNone
--values <string>Path to values.yaml file to use with helm templateNone
--dry-runShow what would be mirrored without copyingfalse
--insecure(skopeo mode only) Allow HTTP connections to target registryfalse
--skip-target-validation(skopeo mode only) Skip target registry connectivity checkfalse
--cert-dir <string>(skopeo mode only) Path to TLS certificates directoryNone
--multi-arch <string>(skopeo mode only) Multi-architecture support: all, system, or index-onlyall
--local-passthroughPull images to a local directory then push to target, instead of direct registry-to-registry copy (skopeo mode only)false
--local-dir <string>Local directory used as intermediate storage for --local-passthrough/tmp
--update-valuesRequires --values. Updates the values.yaml with the target images. If --dry-run is used, this command simply prints a preview in stdoutfalse
--output <file>Requires --update-values. Path for the updated values.yaml. If not specified, writes to ~/.witboost-infra/output/updated_<filename> instead of overwriting the original --values fileNone

Examples​

Dry run​

This options allows to preview the computed names for the target images

witboost-infra mirror-images --witboost-version 1.0.0 --target registry.company.com --dry-run

Basic mirroring​

witboost-infra mirror-images --witboost-version 1.0.0 --target registry.company.com

Mirror with prefix​

Depending on your registry configuration, you might want to specify a prefix to properly store the images.

witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target registry.company.com \
--prefix foo/bar/witboost

This command will mirror the images under the following path, for example:

registry.agilelab.com/witboost_image:1.0.0 --> registry.company.com/foo/bar/witboost/witboost_image:1.0.0

Mirror with custom values.yaml​

When you need to mirror images based on a specific configuration, you can provide a custom values.yaml file:

witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target registry.company.com \
--values /path/to/your/values.yaml

This will use your custom values.yaml file with the helm template command to extract the exact images that would be deployed with your configuration.

note

Any pre-existing image: or engine: overrides in the provided values file are ignored when determining which images to mirror — the file is only used to figure out which services are enabled/disabled (and any other non-image configuration). The images actually extracted and mirrored always come from the chart's own canonical defaults for the given --witboost-version. Use --update-values (see below) to repoint those overrides at the freshly mirrored images afterwards.

Using Docker mode (fallback)​

If Skopeo is not available, you can use Docker mode as a fallback:

witboost-infra mirror-images --witboost-version 1.0.0 --target registry.company.com --mode docker
note

Docker mode requires Docker daemon to be running and will pull images locally before pushing them to the target registry. This mode uses more disk space and may be slower than Skopeo mode.

warning

The authentication is managed by executing a docker login with the provided target credentials. However, if your target requires custom configuration (e.g. insecure registries, certificates etc.) you will need to prepare your local docker configuration (e.g. daemon.json)

Skip validation​

Before mirroring images, the cli tries to validate the access to the registry. In some corner cases, some registries configurations could lead this validation to fail, while the mirroring could work anyways. In these scenarios, the validation can be skipped with the --skip-target-validation option.

witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target registry.company.com \
--skip-target-validation

AWS ECR​

For AWS Elastic Container Registry (ECR), you need to generate temporary credentials using the AWS CLI.

::: warning

In ECR you need to create the repositories beforehand, you can leverage the witboost-infra mirror-images --dry-run command to list all the images that will be mirrored, and aws ecr create-repository --repository-name <name> to create the corresponding repositories in ECR before starting the mirroring. If you omit the repositories creation, the mirror command will throw an error saying that the repository does not exist in the registry.

:::

# Get ECR login token and check docker login
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-west-2.amazonaws.com
# Mirror with ECR credentials
witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target 123456789012.dkr.ecr.us-west-2.amazonaws.com \
--target-username AWS \
--target-password $(aws ecr get-login-password --region us-west-2)

Note: The --target-password is dynamically generated using aws ecr get-login-password which provides a temporary token valid for 12 hours.

Azure ACR​

For Azure Container Registry (ACR), there are several authentication methods you can use, you can find more here.

The following examples uses Individual Microsoft Entra identity as authentication mechanism.

# Get login token
az acr login --name myregistry --expose-token --query accessToken --output tsv

# Mirror with user token
witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target myregistry.azurecr.io \
--target-username 00000000-0000-0000-0000-000000000000 \
--target-password $(az acr login --name myregistry --expose-token --query accessToken --output tsv)

Local passthrough (skopeo mode only)​

The --local-passthrough option pulls each image from the source registry to a local directory, then immediately pushes it to the target — one image at a time. The local copy is deleted as soon as each image is pushed.

This is different from the automatic retry described at the top of this page: without --local-passthrough, every image is copied directly registry-to-registry and only falls back to a local pull/push if that direct copy fails. With --local-passthrough, every image always goes through the local directory from the start.

note

--local-passthrough requires skopeo mode (the default). It cannot be used with --mode docker.

witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target registry.company.com \
--local-passthrough \
--local-dir /custom/dir

The default for --local-dir is /tmp. Use --dry-run to preview the source → local → target mapping without downloading anything.

Update values.yaml with mirrored image locations​

The --update-values option updates your values.yaml file so it points at the images that were just mirrored, instead of the default Witboost registry.

It requires --values to also be provided, and it only rewrites image: blocks that already exist in that file (as well as Hasura's non-standard engine: block, which holds its main image the same way image: does elsewhere) — components relying on the chart's default image (no override block present) are left untouched. For each matching block, the tool determines which component it belongs to and looks up the exact image that was actually mirrored for that component; the registry (or repository) field is repointed to the mirrored target location and the tag is updated to match.

By default, this does not overwrite the original --values file — it writes the updated copy to ~/.witboost-infra/output/updated_<filename>, leaving your original file untouched. Use --output <file> to choose a different destination, including pointing it back at the original file if you explicitly want to overwrite it in place (make sure it's committed or backed up beforehand if you do).

An existing image: (or engine:) block is left unchanged (with a warning) when it can't be tied to an actually-mirrored image:

  • Component is disabled: Component '<name>' is disabled (enabled: false) in <values file>, so no image was mirrored for it — the component has enabled: false in the values file, so it never rendered and nothing was mirrored for it.
  • Component didn't render / isn't a chart dependency: Component '<name>' did not produce any mirrored image for Witboost version <version> — the block's top-level key doesn't correspond to any subchart that rendered a container image (e.g. it's a stale/placeholder field, or a resource owned directly by the umbrella chart itself, like a hook Job, rather than a subchart).
  • Ambiguous match: Multiple mirrored images found for component '<name>' — the component renders more than one image and the tool couldn't uniquely determine which one this specific block should point to.

Conversely, a component can be mirrored but have no image:/engine: block at all in your values file (e.g. it's enabled but relies entirely on the chart's default image) — the tool has nothing to rewrite for it, and warns:

  • Mirrored but no block to update: Component '<name>' was mirrored but has no 'image:'/'engine:' block in <values file> to update; it will keep using the chart's default image unless you add one.

Note that only mirrored images that already have a corresponding image: or engine: block in your values file get updated — if a mirrored component has no existing override block (relying entirely on chart defaults), it's simply not touched and won't appear in the update list, even though its image was mirrored (see the warning above).

witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target registry.company.com \
--prefix foo/bar/witboost \
--values /path/to/your/values.yaml \
--update-values

Write the updated values.yaml to a specific location instead of the default ~/.witboost-infra/output/ path:

witboost-infra mirror-images \
--witboost-version 1.0.0 \
--target registry.company.com \
--prefix foo/bar/witboost \
--values /path/to/your/values.yaml \
--update-values \
--output /path/to/your/values.updated.yaml
note

This also applies with --dry-run: instead of writing any file, it prints a preview of the registry/repository paths and tags that would be updated, along with the path the updated file would be written to (the default ~/.witboost-infra/output/updated_<filename> or whatever --output was set to). This preview is printed in addition to — after — the usual --dry-run source → target image mapping table, so with both --dry-run and --update-values set you'll see both previews in the same run.