$ podman login -u $(oc whoami) -p $(oc whoami -t) $(oc -n openshift-image-registry get route default-route -o jsonpath='{.spec.host}')
Use the following section for instructions on accessing the registry.
You can access the registry directly to invoke podman
commands. This allows
you to push images to or pull them from the integrated registry directly using
operations like podman push
or podman pull
. To do so, you must be logged in
to the registry using the oc login
command. The operations you can perform
depend on your user permissions, as described in the following sections.
You can access the registry from inside the cluster.
Access the registry from the cluster by using internal routes:
Log in to the container image registry by using your access token:
$ podman login -u $(oc whoami) -p $(oc whoami -t) $(oc -n openshift-image-registry get route default-route -o jsonpath='{.spec.host}')
You should see a message confirming login, such as:
Login Succeeded!
You can pass any value for the user name; the token contains all necessary information. Passing a user name that contains colons will result in a login failure. Since the Image Registry Operator creates the route, it will likely be similar to
|
Perform podman pull
and podman push
operations against your registry:
You can pull arbitrary images, but if you have the system:registry role added, you can only push images to the registry in your project. |
In the following examples, use:
Component | Value |
---|---|
<registry_url> |
|
<project> |
|
<image> |
|
<tag> |
omitted (defaults to |
Pull an arbitrary image:
$ podman pull name.io/image
Tag the new image with the form <registry_url>:<project>/<image>
.
The project name must appear in this pull specification for OpenShift Dedicated to
correctly place and later access the image in the registry:
$ podman tag name.io/image $(oc -n openshift-image-registry get route default-route -o jsonpath='{.spec.host}')/openshift/image
You must have the |
Push the newly-tagged image to your registry:
$ podman push $(oc -n openshift-image-registry get route default-route -o jsonpath='{.spec.host}')/openshift/image