mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
72 lines
3.9 KiB
Plaintext
72 lines
3.9 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * installing/disconnected_install/installing-mirroring-installation-images.adoc
|
|
|
|
ifdef::openshift-origin[]
|
|
:index-image-pullspec: quay.io/operatorhubio/catalog:latest
|
|
:index-image: catalog
|
|
endif::[]
|
|
ifndef::openshift-origin[]
|
|
:index-image-pullspec: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
|
|
:index-image: redhat-operator-index
|
|
endif::[]
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="olm-mirror-catalog-colocated_{context}"]
|
|
= Mirroring catalog contents to registries on the same network
|
|
|
|
If your mirror registry is co-located on the same network as your workstation with unrestricted network access, take the following actions on your workstation.
|
|
|
|
.Procedure
|
|
|
|
. If your mirror registry requires authentication, run the following command to log in to the registry:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ podman login <mirror_registry>
|
|
----
|
|
|
|
. Run the following command to extract and mirror the content to the mirror registry:
|
|
+
|
|
--
|
|
[source,terminal]
|
|
----
|
|
$ oc adm catalog mirror \
|
|
<index_image> \ <1>
|
|
<mirror_registry>:<port>[/<repository>] \ <2>
|
|
[-a ${REG_CREDS}] \ <3>
|
|
[--insecure] \ <4>
|
|
[--index-filter-by-os='<platform>/<arch>'] \ <5>
|
|
[--manifests-only] <6>
|
|
----
|
|
<1> Specify the index image for the catalog that you want to mirror.
|
|
<2> Specify the fully qualified domain name (FQDN) for the target registry to mirror the Operator contents to. The mirror registry `<repository>` can be any existing repository, or namespace, on the registry, for example `olm-mirror` as outlined in the prerequisites. If there is an existing repository found during mirroring, the repository name is added to the resulting image name. If you do not want the image name to include the repository name, omit the `<repository>` value from this line, for example `<mirror_registry>:<port>`.
|
|
<3> Optional: If required, specify the location of your registry credentials file.
|
|
`{REG_CREDS}` is required for `registry.redhat.io`.
|
|
<4> Optional: If you do not want to configure trust for the target registry, add the `--insecure` flag.
|
|
<5> Optional: Specify which platform and architecture of the index image to select when multiple variants are available. Images are passed as `'<platform>/<arch>[/<variant>]'`. This does not apply to images referenced by the index. Valid values are `linux/amd64`, `linux/ppc64le`, `linux/s390x`, `linux/arm64`.
|
|
<6> Optional: Generate only the manifests required for mirroring without actually mirroring the image content to a registry. This option can be useful for reviewing what will be mirrored, and lets you make any changes to the mapping list, if you require only a subset of packages. You can then use the `mapping.txt` file with the `oc image mirror` command to mirror the modified list of images in a later step. This flag is intended for only advanced selective mirroring of content from the catalog.
|
|
--
|
|
+
|
|
--
|
|
.Example output
|
|
[source,terminal,subs="attributes+"]
|
|
----
|
|
src image has index label for database path: /database/index.db
|
|
using database path mapping: /database/index.db:/tmp/153048078
|
|
wrote database to /tmp/153048078 <1>
|
|
...
|
|
wrote mirroring manifests to manifests-{index-image}-1614211642 <2>
|
|
----
|
|
<1> Directory for the temporary `index.db` database generated by the command.
|
|
<2> Record the manifests directory name that is generated. This directory is referenced in subsequent procedures.
|
|
+
|
|
[NOTE]
|
|
====
|
|
{quay} does not support nested repositories. As a result, running the `oc adm catalog mirror` command will fail with a `401` unauthorized error. As a workaround, you can use the `--max-components=2` option when running the `oc adm catalog mirror` command to disable the creation of nested repositories. For more information on this workaround, see the link:https://access.redhat.com/solutions/5440741[Unauthorized error thrown while using catalog mirror command with Quay registry] Knowledgebase Solution.
|
|
====
|
|
--
|
|
|
|
:!index-image-pullspec:
|
|
:!index-image:
|