= Accessing the internal {openshift} registry

The {ocp} cluster running in the {prod} instance includes an internal container image registry by default.
This internal container image registry can be used as a publication target for locally developed container images.
To access the internal {ocp} registry, follow these steps.

.Prerequisites
* {prod} is configured to use the {openshift} preset.
For more information, see link:{crc-gsg-url}#changing-the-selected-preset_gsg[Changing the selected preset].
* A running {prod} instance.
For more information, see link:{crc-gsg-url}#starting-the-instance_gsg[Starting the instance].
* A working {openshift} CLI ([command]`oc`) command.
For more information, see link:{crc-gsg-url}#accessing-the-openshift-cluster-with-oc_gsg[Accessing the {openshift} cluster with the {openshift} CLI].

.Procedure
. Check which user is logged in to the cluster:
+
[subs="+quotes,attributes"]
----
$ oc whoami
----
+
[NOTE]
====
For demonstration purposes, the current user is assumed to be `kubeadmin`.
====

. Log in to the registry as that user with its token:
+
[subs="+quotes,attributes"]
----
$ oc registry login --insecure=true
----

. Create a new project:
+
[subs="+quotes,attributes"]
----
$ oc new-project demo
----

. Mirror an example container image:
+
[subs="+quotes,attributes"]
----
$ oc image mirror registry.access.redhat.com/ubi8/ubi:latest=default-route-openshift-image-registry.apps-crc.testing/demo/ubi8:latest --insecure=true --filter-by-os=linux/amd64
----

. Get imagestreams and verify that the pushed image is listed:
+
[subs="+quotes,attributes"]
----
$ oc get is
----

. Enable image lookup in the imagestream:
+
[subs="+quotes,attributes"]
----
$ oc set image-lookup ubi8
----
+
This setting allows the imagestream to be the source of images without having to provide the full URL to the internal registry.

. Create a pod using the recently pushed image:
+
[subs="+quotes,attributes"]
----
$ oc run demo --image=ubi8 --command -- sleep 600s
----
