Use automatic recovery in image mode for RHEL systems
To use automatic recovery for {product-title} on RHEL image-based systems, you can embed the 10-auto-recovery.conf and microshift-auto-recovery.service files in your Containerfile and rebuild the bootc image.
|
|
You must include the entire |
-
You created a Containerfile as instructed in Building the bootc image.
-
You created the
10-auto-recovery.confandmicroshift-auto-recovery.servicefiles as explained in the "Using auto-recovery in RPM systems" section.The location of the
10-auto-recovery.confandmicroshift-auto-recovery.servicefiles must be relative to the Containerfile.For example, if the path to the Containerfile is
/home/microshift/my-build/Containerfile, the systemd files need to be adjacent for proper embedding. The following paths are correct for this example:-
/home/microshift/my-build/auto-rec/10-auto-recovery.conf -
/home/microshift/my-build/auto-rec/microshift-auto-recovery.service -
/home/microshift/my-build/auto-rec/microshift-auto-recovery
-
-
You created the
microshift-auto-recoveryscript as explained in the "Using auto-recovery in RPM systems" section.
-
Use the following example snippet to update the container file that you use to prepare the image mode for RHEL image.
RUN mkdir -p /usr/lib/systemd/system/microshift.service.d COPY ./auto-rec/10-auto-recovery.conf /usr/lib/systemd/system/microshift.service.d/10-auto-recovery.conf COPY ./auto-rec/microshift-auto-recovery.service /usr/lib/systemd/system/ COPY ./auto-rec/microshift-auto-recovery /usr/bin/ RUN chmod +x /usr/bin/microshift-auto-recoveryPodman uses the host subscription information and repositories inside the container when building the container image. If the
rhocpandfast-datapathrepositories are not available on the host, the build fails. -
Rebuild your local bootc image by running the following image build command:
PULL_SECRET=~/.pull-secret.json USER_PASSWD=<your_redhat_user_password> IMAGE_NAME=microshift-4.18-bootc sudo podman build --authfile "${PULL_SECRET}" -t "${IMAGE_NAME}" \ --build-arg USER_PASSWD="${USER_PASSWD}" \ -f ContainerfileSecrets are used during the image build in the following ways:
-
The podman
--authfileargument is required to pull the baserhel-bootc:9.4image from theregistry.redhat.ioregistry. -
The build
USER_PASSWDargument is used to set a password for theredhat user.
-
-
Verify that the local bootc image was created by running the following command:
$ sudo podman images "${IMAGE_NAME}"Example outputREPOSITORY TAG IMAGE ID CREATED SIZE localhost/microshift-4.18-bootc latest 193425283c00 2 minutes ago 2.31 GB