Skip to content

Instantly share code, notes, and snippets.

@bruno-brant
Last active February 14, 2024 11:04
Show Gist options
  • Save bruno-brant/b4d4935cb33828f48d18078c294eb12b to your computer and use it in GitHub Desktop.
Save bruno-brant/b4d4935cb33828f48d18078c294eb12b to your computer and use it in GitHub Desktop.
How to push docker images to openshift internal registry and create application from it

How to push docker images to openshift internal registry and create application from it

Assuming you have the OCP (openshift container platform) cluster ready and the user has image push permissions on a namespace (ex:- dev)

TL;DR

  • Grab the Cluster IP Address of internal docker registry
  • tag the local image to internal docker registry
  • grab the auth token and login to inter docker registry
  • push the tagged image to internal registry

Grab the cluster ip address provided for openshift internal registry

  • oc get svc -n default | grep registry #172.30.43.173

Create a new project to test

  • oc new-project test

Tag your local image to remote reg

  • docker tag localimage 172.30.43.173:5000/test/localimage #WTmRhkFBQS9WD1PzzUDpp_JPygROAOMZa8R67j586P8

login to internal docker reg

  • docker login -p WTmRhkFBQS9WD1PzzUDpp_JPygROAOMZa8R67j586P8 -e unused -u unused 172.30.43.173:5000

Push image to internal registry

  • docker push 172.30.43.173:5000/test/localimage

Create a new app 'myapp' using the pushed image

  • oc new-app test/localimage --name=myapp
@sshiradwade-synamedia
Copy link

How can I use image thats not pushed to my registry but its in my "docker images" into my kubernetes deployment or pods "image" field ?

@bruno-brant
Copy link
Author

How can I use image thats not pushed to my registry but its in my "docker images" into my kubernetes deployment or pods "image" field ?

You'll need to push to the internal registry.

@eandi
Copy link

eandi commented Nov 14, 2023

I have the same problem and docker push is keep retrying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment