I will explain the “how can we image push openshift internal image registry” today. For this topic we need the linux machine that contains the docker and access the openshift cluster.

I suppose the we have specific image like “hafifbilgiler/nginx:1.0.0” or something different on your docker image registry.

We must obtain the openshift internal image registry address, because we will use the address on the image name.

oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}'

Add tag your image with openshift image registry route address and your namespace name.

docker tag hafifbilgiler/nginx:1.0.0 image-registry.openshift-image-registry.svc/<namespace-address>/hafifbilgiler-nginx:1.0.0

Login your openshift image registry with your admin capability user or that access and has a permission user. Below command will login image registry with your user and your token of user.

docker login -u `oc whoami` -p `oc whoami --show-token` https://image-registry.openshift-image-registry.svc

Alright we can push the our image now.

docker push image-registry.openshift-image-registry.svc/<namespace-address>/hafifbilgiler-nginx:1.0.0

We can find the our new image name from the internal image registry.

oc get images | grep "hafifbilgiler-nginx:1.0.0"

We can use the our image name in the our deploymenyt,pod or etc. yaml file. Our image name contains the sha256 number like below.



No responses yet

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

Latest Comments