OC-ADM-CATALOG-MIRROR(1)
π OC ADM CATALOG(1) β oc adm catalog mirror
hey bestie, welcome to the OpenShift CLI User Manuals β¨ this one's all about oc adm catalog mirror, and honestly it's kind of a big deal π
πΈ NAME
oc adm catalog mirror β mirror an operator-registry catalog πͺ
β¨ SYNOPSIS
oc adm catalog mirror [OPTIONS]
π¦ DESCRIPTION
So basically, this command mirrors the contents of a catalog into a registry. Slay. π
Here's the whole glow-up: it pulls down an image containing a catalog, extracts it to disk, queries it to find all of the images used in the manifests, and then mirrors them to a target registry. The way it does all four of those things in one go? Iconic, no cap.
By default, the catalog files are extracted to a temporary directory, but like, you can save them locally via flags if you're that kind of person π«Ά
An image content source policy gets written to a file that can be added to a cluster with access to the target registry. That's the whole point, fr fr β it configures the cluster to pull from the mirrors instead of the locations referenced in the operator manifests.
A mapping.txt file is also created that is compatible with oc image mirror. You may use it to further customize the mirroring configuration, but lowkey you shouldn't need it in normal circumstances.
β οΈ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! β οΈ !! DEPRECATION NOTICE: β οΈ !! Sqlite-based catalogs are deprecated. Support for them will be removed in a β οΈ !! future release. Please migrate your catalog workflows to the new file-based β οΈ !! catalog format. β οΈ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! not me begging you to migrate π sqlite catalogs are deprecated, bestie β support is getting removed in a future release. move your catalog workflows to the new file-based catalog format, please and thank you π
π OPTIONS
--certificate-authority=""β the path to a certificate authority bundle to use when communicating with the managed container image registries. Heads up: if--insecureis used, this flag is ignored entirely π--continue-on-error=trueβ if an error occurs while mirroring, keep going and attempt to mirror as much as possible. resilient queen energy π--dir=""β the directory on disk thatfile://images will be copied under.--dry-run=falseβ print the actions that would be taken and exit without writing to the destinations. peek, don't touch β¨--from-dir=""β the directory on disk thatfile://images will be read from. overrides--dir.--idms-scope="repository"β scope of registry mirrors in the imagedigestmirrorset file. allowed values:repository,registry. defaults to:repository.--index-filter-by-os=""β a regular expression to control which index image is picked when multiple variants are available. images will be passed as'<platform>/<architecture>[/<variant>]'. this does not apply to images referenced by the index π--insecure=falseβ allow push and pull operations to registries to be made over HTTP.--manifests-only=falseβ calculate the manifests required for mirroring, but don't actually mirror image content.--max-components=2β the maximum number of path components allowed in a destination mapping. example:quay.io/org/repohas two path components.--max-idms-size=250000β the maximum number of bytes for the generated IDMS yaml(s). defaults to250000.--max-per-registry=4β number of concurrent requests allowed per registry.--path=""β specify an in-container to local path mapping for the index file(s).-a,--registry-config=""β path to your registry credentials. alternatively theREGISTRY_AUTH_FILEenv variable can be also specified. defaults to${XDG_RUNTIME_DIR}/containers/auth.json,/run/containers/${UID}/auth.json,${XDG_CONFIG_HOME}/containers/auth.json,${DOCKER_CONFIG},/.docker/config.json,/.dockercfg. the order can be changed via theREGISTRY_AUTH_PREFERENCEenv variable (deprecated) to a"docker"value to prioritize Docker credentials over Podman's.--skip-verification=falseβ skip verifying the integrity of the retrieved content. this is not recommended, but may be necessary when importing images from older image registries. only bypass verification if the registry is known to be trustworthy π₯--to-manifests=""β local path to store manifests.
π OPTIONS INHERITED FROM PARENT COMMANDS
these ones came from the parent commands, and they're just as iconic π
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace.--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups.--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β default cache directory.--client-certificate=""β path to a client certificate file for TLS.--client-key=""β path to a client key file for TLS.--cluster=""β the name of the kubeconfig cluster to use.--context=""β the name of the kubeconfig context to use.--disable-compression=falseβ if true, opt-out of response compression for all requests to the server.--insecure-skip-tls-verify=falseβ if true, the server's certificate will not be checked for validity. this will make your HTTPS connections insecure π¬--kubeconfig=""β path to the kubeconfig file to use for CLI requests.--kuberc=""β path to the kuberc file to use for preferences. this can be disabled by exporting theKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off.--match-server-version=falseβ require server version to match client version.-n,--namespace=""β if present, the namespace scope for this CLI request.--profile="none"β name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex).--profile-output="profile.pprof"β name of the file to write the profile to.--request-timeout="0"β the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). a value of zero means don't timeout requests.-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. if it is not provided, the hostname used to contact the server is used.--token=""β bearer token for authentication to the API server.--user=""β the name of the kubeconfig user to use.--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code.
π EXAMPLE
okay this is the part where it gets good β copy these exactly, bestie π«Ά
# Mirror an operator-registry image and its contents to a registry
oc adm catalog mirror quay.io/my/image:latest myregistry.com
# Mirror an operator-registry image and its contents to a particular namespace in a registry
oc adm catalog mirror quay.io/my/image:latest myregistry.com/my-namespace
# Mirror to an airgapped registry by first mirroring to files
oc adm catalog mirror quay.io/my/image:latest file:///local/index
oc adm catalog mirror file:///local/index/my/image:latest my-airgapped-registry.com
# Configure a cluster to use a mirrored registry
oc apply -f manifests/imageDigestMirrorSet.yaml
# Edit the mirroring mappings and mirror with "oc image mirror" manually
oc adm catalog mirror --manifests-only quay.io/my/image:latest myregistry.com
oc image mirror -f manifests/mapping.txt
# Delete all ImageDigestMirrorSets generated by oc adm catalog mirror
oc delete imagedigestmirrorset -l operators.openshift.org/catalog=true
β SEE ALSO
π§ HISTORY
June 2016, ported from the Kubernetes man-doc generator πΈ
and that's the whole page, bestie!! π this gem came to you from the Openshift CLI User Manuals, dated June 2016 β ngl it's giving vintage but it still ate π β¨
π¦ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms