How-To – push a docker image from docker registry to #openshift registry

This how-to covers what has to be done to push an image that is available in a docker registry into openshift registry.

We’ll use a project sample here.

oc project sample-prj
  • suppose there is an image foo-image:latest in docker registry.

You have to find out the clusterIP of the docker registry service. This needs additional rights!

# oc get svc/docker-registry -n default
NAME              CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
docker-registry   <clusterIP>     <none>        5000/TCP

Tag image for the clusterIP, Port 5000 and project:

docker tag foo-image:latest <clusterIP>:5000/sample-prj/foo-image:latest

Log into Openshift registry

docker login -u $(oc whoami) –p $(oc whoami -t) -e foo@foo.com <clusterIP>:5000

Push into Openshfit registry

docker push <clusterIP>:5000/sample-prj/foo-image:latest

Additionaly you will find an automatically created imagestream.

oc get is .... name foo-image