// Module included in the following assemblies:
//
// microshift_install_bootc/microshift-install-rhel-bootc-image.adoc

:_mod-docs-content-type: PROCEDURE
[id="microshift-bootc-publish-image_{context}"]
= Publishing the bootc image to the remote registry

[role="_abstract"]
Publish your bootc image to the remote registry so that the image can be used for running the container on another host, or for when you want to install a new operating system with the bootc image layer.

.Prerequisites

* You are logged in to the {op-system-base} {op-system-version} host where the image was built using the user credentials that have `sudo` permissions.
* You have a remote registry such as link:https://quay.io[{quay}] for storing and accessing bootc images.
* You created the Containerfile and built the image.

.Procedure

. Set the `REGISTRY_URL` variable for the image by running the following command:
+
[source,terminal,subs="+quotes"]
----
$ REGISTRY_URL=_<quay.io>_
----
+
Replace `_<quay.io>_` with the URL for your image registry.

. Log in to your remote registry by running the following command:
+
[source,terminal,subs="+quotes"]
----
$ sudo podman login "${REGISTRY_URL}"
----

. Set the `IMAGE_NAME` variable for the image by running the following command:
+
[source,terminal,subs="attributes+,quotes"]
----
$ IMAGE_NAME=_<microshift-{product-version}-bootc>_
----
+
Replace _<microshift-{product-version}-bootc>_ with the name of the image you want to publish.

. Set the `REGISTRY_IMG` variable for the image by running the following command:
+
[source,terminal,subs="+quotes"]
----
$ REGISTRY_IMG=_<myorg/mypath>_/"${IMAGE_NAME}"
----
+
Replace `_<myorg/mypath>_` with your remote registry organization name and path.

. Publish the image by running the following command:
+
[source,terminal]
----
$ sudo podman push localhost/"${IMAGE_NAME}" "${REGISTRY_URL}/${REGISTRY_IMG}"
----

.Verification

. Run the container using the image you pushed to your registry as described in the "Running the {microshift-short} bootc container" section.
