Mirror from mirror to mirror

You can use the oc-mirror plugin to mirror an image set directly to a target mirror registry that is accessible during image set creation.

Prerequisites
  • You have access to the internet to get the required container images.

  • You installed the OpenShift CLI (oc).

  • You installed the oc-mirror CLI plugin.

  • You created the image set configuration file.

Procedure
  • Mirror the images from the specified image set configuration to a specified registry by running the following command:

    $ oc-mirror --config imageset-config.yaml --workspace file://<em><v2_workspace></em> \//
      docker://<em><remote_registry></em> --v2
    • You must use the --workspace flag for the mirror-to-mirror process. Replace <v2_workspace> with the directory you want to use to store custom resources for the mirroring process.

    • Replace <remote_registry> with the name of the registry to mirror the image set file to. The registry must start with docker://. If you specify a top-level namespace for the mirror registry, you must also use this same namespace on later executions.

      Example output
      Rendering catalog image "registry.example.com/redhat/redhat-operator-index:v{ocp-version}" with file-based catalog
      Important

      You must use the ImageDigestMirrorSet YAML file as reference content for manual configuration of CRI-O in MicroShift. You cannot apply the resource directly into a MicroShift node.

Verification
  1. List the contents of the cluster-resources subdirectory by running the following command:

    $ ls <v2_workspace>/working-dir/cluster-resources/

    Replace <v2_workspace> with the directory you used to store custom resources for the mirroring process.

Next steps
  • Convert the ImageDigestMirrorSet YAML content for use in manually configuring CRI-O.

  • If required, mirror the images from mirror to disk for disconnected or offline use.