We are trying to set up an OpenShift flow as close to the defaults as possible, without having to use Jenkins.
So far I have managed to adapt a s2i-generated Dockerfile to our needs (to get the benefits of the s2i images) and set up a simple "oc new-app" pipeline which creates a build following a git repository pushing the generated docker image to an image stream and a deployment triggered by the image stream update pushing to a default pod. This works well.
Now we want to additionally have this docker image pushed to an external docker repository (the RED HAT CONTAINER REGISTRY known by OpenShift) and I would essentially like to keep the existing flow instead of adapting it to use the external registry instead of the internal.
So, can I set up a "build" or something like it which does nothing but take that image and push it to the docker registry? How do I set it up using the oc
command?
Would you like to push the image builded by
buildConfig
to external registry, right ? I think the work flow is like this:Using Docker Credentials for Private Registries.secret
Link the
secret
withbuilder
ServiceAccount
.Configure the build image push target in the
buildConfig
as follows.I hope it help you.