mirror of
https://github.com/openshift/image-registry.git
synced 2026-02-05 18:45:15 +01:00
1.9 KiB
1.9 KiB
How to deploy development build of image registry
Prerequisites
- An OpenShift cluster.
- Credentials from the app.ci cluster.
- A public image repository (for example, you can create a public repository on quay.io).
Logging into the app.ci cluster and its registry
-
Copy the login command from https://console-openshift-console.apps.ci.l2s4.p1.openshiftapps.com/ and run it
-
Rename the context for the
app.ciclusteroc config rename-context "$(oc config current-context)" app.ci -
Login into the registry
registry.ci.openshift.orgoc --context=app.ci whoami -t | docker login -u unused --password-stdin "$(oc --context=app.ci registry info --public=true)"
Switching the image registry operator into the Unmanaged mode
-
You'll need to change the image registry deployment manually, so disable the image registry operator
oc patch configs.imageregistry cluster --type=merge -p '{"spec":{"managementState":"Unmanaged"}}'
Building and deploying a new container image
-
Go to the directory with the image registry sources
cd ./openshift/image-registry -
Build a new image
docker build -f Dockerfile.rhel7 -t quay.io/rh-obulatov/image-registry . -
Push the new image
docker push quay.io/rh-obulatov/image-registry -
Deploy the new build
oc -n openshift-image-registry set image deploy/image-registry registry="$(docker inspect --format='{{index .RepoDigests 0}}' quay.io/rh-obulatov/image-registry)" -
Wait until the pods use the new image
oc -n openshift-image-registry get pods -l docker-registry=default -o custom-columns="NAME:.metadata.name,STATUS:.status.phase,IMAGE:.spec.containers[0].image" -
Enjoy your registry!