OpenShift: Working with Internal Docker Registry

OpenShift provides an internal container image registry that can be deployed in an OpenShift environment to locally manage images.

Docker Registry Management

It is likely that the registry was deployed automatically during the OpenShift installation process.

Check if the registry service is already present:

$ oc adm registry --dry-run
Docker registry "docker-registry" service exists

Get deployment configuration:

$ oc get dc -n default
docker-registry   1          2         2         config
registry-cosole   1          1         1         config
router            1          2         2         config

Get the image of the registry:

$ oc describe dc/docker-registry -n default | grep Image

Delete Docker Registry

Since we know the image the registry was created from, we can easily recreate it.

Delete the registry and its service account:

$ oc delete all -l docker-registry -n default
$ oc delete serviceaccounts/registry -n default
$ oc delete clusterrolebindings/registry-registry-role -n default

Create a Docker Registry from the Image

Create a docker registry using the image:

$ oc adm registry \ \
  --replicas=2 \
  --selector='region=infra' \
  -n default

Browse Docker Registry

To browse docker registry, you can install docker-registry-cli script:

$ sudo yum install python-flask python-requests git
$ git clone
$ cd docker_registry_cli

Run the following command to expose the integrated docker registry to the hostname

$ oc expose service docker-registry \

The command will create a route with the same name as the service by default. Note that you will need to configure TLS security on the route, or allow insecure docker registries in /etc/docker/daemon.json. Once done, you can list all images in the docker registry:

$ python ./ list all

Leave a Reply

Your email address will not be published. Required fields are marked *