1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/oc-mirror-mirror-to-disk.adoc
Shubha Narayanan 242dd93fdc added --v1
2026-01-21 06:06:02 +00:00

76 lines
2.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * installing/disconnected_install/installing-mirroring-disconnected.adoc
// * updating/updating_a_cluster/updating_disconnected_cluster/mirroring-image-repository.adoc
:_mod-docs-content-type: PROCEDURE
[id="oc-mirror-mirror-to-disk_{context}"]
= Mirroring from mirror to disk
You can use the oc-mirror plugin to generate an image set and save the contents to disk. The generated image set can then be transferred to the disconnected environment and mirrored to the target registry.
[IMPORTANT]
====
Depending on the configuration specified in the image set configuration file, using oc-mirror to mirror images might download several hundreds of gigabytes of data to disk.
The initial image set download when you populate the mirror registry is often the largest. Because you only download the images that changed since the last time you ran the command, when you run the oc-mirror plugin again, the generated image set is often smaller.
====
You are required to specify a storage backend in the image set configuration file. This storage backend can be a local directory or a docker v2 registry. The oc-mirror plugin stores metadata in this storage backend during image set creation.
[IMPORTANT]
====
Do not delete or modify the metadata that is generated by the oc-mirror plugin. You must use the same storage backend every time you run the oc-mirror plugin for the same mirror registry.
====
.Prerequisites
* You have access to the internet to obtain the necessary container images.
* You have installed the OpenShift CLI (`oc`).
* You have installed the oc-mirror CLI plugin.
* You have created the image set configuration file.
// TODO: Don't need a running cluster, but need some pull secrets. Sync w/ team on this
.Procedure
* Run the `oc mirror` command to mirror the images from the specified image set configuration to disk:
+
[source,terminal]
----
$ oc mirror --config=./imageset-config.yaml \// <1>
file://<path_to_output_directory> --v1 <2>
----
<1> Pass in the image set configuration file that was created. This procedure assumes that it is named `imageset-config.yaml`.
<2> Specify the target directory where you want to output the image set file. The target directory path must start with `file://`.
.Verification
. Navigate to your output directory:
+
[source,terminal]
----
$ cd <path_to_output_directory>
----
. Verify that an image set `.tar` file was created:
+
[source,terminal]
----
$ ls
----
+
.Example output
[source,text]
----
mirror_seq1_000000.tar
----
.Next steps
* Transfer the image set .tar file to the disconnected environment.
.Troubleshooting
* link:https://access.redhat.com/solutions/7032017[Unable to retrieve source image].