mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
119 lines
4.5 KiB
Plaintext
119 lines
4.5 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// microshift_running_applications/embed-microshift-offline-deploy.adoc
|
|
// microshift_install_rpm_ostree/microshift-embed-rpm-ostree-offline-use.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="microshift-embed-microshift-image-offline-deployment_{context}"]
|
|
= Embedding {microshift-short} containers for offline deployments
|
|
|
|
You can use image builder to create `rpm-ostree` system images with embedded {microshift-short} container images. To embed container images, you must add the image references to your image builder blueprint.
|
|
|
|
.Prerequisites
|
|
|
|
* You have root-user access to your build host.
|
|
* Your build host meets the image builder system requirements.
|
|
* You have installed and set up image builder and the `composer-cli` tool.
|
|
* You have created a {op-system-ostree} image blueprint.
|
|
* You have installed jq.
|
|
|
|
.Procedure
|
|
|
|
. Get the exact list of container image references used by the {microshift-short} version you are deploying. You can either install the `microshift-release-info` RPM package by following step 2 or download and unpack the RPM by following step 3.
|
|
|
|
. To install the `microshift-release-info` RPM package:
|
|
|
|
.. Install the `microshift-release-info` RPM package by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo dnf install -y microshift-release-info-<release_version>
|
|
----
|
|
Replace `<release_version>` with the numerical value of the release you are deploying, using the entire version number, such as `4.18.1`.
|
|
|
|
.. List the contents of the `/usr/share/microshift/release` directory to verify the presence of the release information files by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ ls /usr/share/microshift/release
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
release-x86_64.json
|
|
release-aarch64.json
|
|
----
|
|
+
|
|
If you installed the `microshift-release-info` RPM, you can proceed to step 4.
|
|
|
|
. If you did not complete step 2, download and unpack the `microshift-release-info` RPM without installing it:
|
|
|
|
.. Download the RPM package by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo dnf download microshift-release-info-<release_version>
|
|
----
|
|
Replace `<release_version>` with the numerical value of the release you are deploying, using the entire version number, such as `4.18.1`.
|
|
+
|
|
.Example rpm
|
|
[source,terminal]
|
|
----
|
|
microshift-release-info-4.18.1.*.el9.noarch.rpm <1>
|
|
----
|
|
<1> The `*` represents the date and commit ID. Your output should contain both, for example `-202511101230.p0.g7dc6a00.assembly.4.18.1`.
|
|
|
|
.. Unpack the RPM package without installing it by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ rpm2cpio <my_microshift_release_info> | cpio -idmv <1>
|
|
./usr/share/microshift/release/release-aarch64.json
|
|
./usr/share/microshift/release/release-x86_64.json
|
|
----
|
|
<1> Replace `<my_microshift_release_info>` with the name of the RPM package from the previous step.
|
|
|
|
. Define the location of your JSON file, which contains the container reference information, by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ RELEASE_FILE=</path/to/your/release-$(uname -m).json>
|
|
----
|
|
Replace `</path/to/your/release-$(uname -m).json>` with the full path to your JSON file. Be sure to use the file needed for your architecture.
|
|
|
|
. Define the location of your TOML file, which contains instructions for building the image, by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ BLUEPRINT_FILE=</path/to/your/blueprint.toml>
|
|
----
|
|
Replace `</path/to/your/blueprint.toml>` with the full path to your JSON file.
|
|
|
|
. Generate and then embed the container image references in your blueprint TOML file by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ jq -r '.images | .[] | ("[[containers]]\nsource = \"" + . + "\"\n")' "${RELEASE_FILE}" >> "${BLUEPRINT_FILE}"
|
|
----
|
|
+
|
|
.Example resulting `<my_blueprint.toml>` fragment showing container references
|
|
[source,terminal]
|
|
----
|
|
[[containers]]
|
|
source = "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:82cfef91557f9a70cff5a90accba45841a37524e9b93f98a97b20f6b2b69e5db"
|
|
|
|
[[containers]]
|
|
source = "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:82cfef91557f9a70cff5a90accba45841a37524e9b93f98a97b20f6b2b69e5db"
|
|
----
|
|
|
|
. You can manually embed any container image by adding it to the image builder blueprint using the following example:
|
|
+
|
|
.Example section for manually embedding container image to image builder
|
|
[source,terminal]
|
|
----
|
|
[[containers]]
|
|
source = "<my_image_pullspec_with_tag_or_digest>"
|
|
----
|
|
Replace `<my_image_pullspec_with_tag_or_digest>` with the exact reference to a container image used by the {microshift-short} version you are deploying.
|