Accessing and Using the Internal OpenShift Registry

The following is how to enable the OpenShift Internal Registry on the IBM Cloud’s hosted OpenShift.

  1. Login to ibmcloud using the commandline tool
$ ibmcloud login --sso    
  1. Select your account

  2. Setup OpenShift Cluster access

$ ibmcloud oc cluster config -c rdr-ocp-base-lon06-pdb --admin
  1. Type oc login (it’ll tell you where to request the oauth token)

  2. Get a token at

$ oc login --token=sha256~aaa --server=
Logged into "" as "" using the token provided.

You have access to 63 projects, the list has been suppressed. You can list all projects with 'oc projects'

Using project "default".
  1. Setup the external route for the Image Registry
$ oc patch --patch '{"spec":{"defaultRoute":true}}' --type=merge patched
  1. Check the OpenShift Image registry host and you see the hostname printed.
$ oc get route default-route -n openshift-image-registry --template='{{ }}'
  1. Make the local registry lookup use relative names
$ oc set image-lookup  --all
  1. Login to the Docker Registry
$ docker login -u $(oc whoami) -p $(oc whoami -t)
Login Succeeded
  1. Pull Nginx
$ docker pull nginx
  1. Tag the Image for the Image Registry
$ docker tag nginx:latest$(oc project --short=true)/nginx-int:latest
  1. Push the Image into the OpenShift Image Registry
$ docker push$(oc project --short=true)/nginx-int:latest 
  1. Use image-registry.openshift-image-registry.svc:5000/default/nginx-int:latest as the image name in your deployment
$ oc run test-a --image image-registry.openshift-image-registry.svc:5000/default/nginx-int:latest
pod/test-a created


  1. OpenShift 4.10: Exposing the Image Registry

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.