Steps to push the local S2I builder image to OpenShift Origin Internal Docker Registry
In my previous blog “Hands on with deploying Microservices into Docker Containers using OpenShift S2I” have built an image using s2i, to use as a builder image. In here I’m going to explain about how we can push our local built image to OpenShift Origin Internal Docker Registry and use it for application build.
Note: When starting your openshift cluster use the below command to provide config and data directories, otherwise when we up the cluster next time the previous data will be lost.
- As a initial step, consider that there is a user created as “ajan”. This user will not have access to the cluster resources. When you login you will see a screen like below after creating the project.
To provide access to cluster resources to the use “ajan” execute the below commands.
After this only we can see the docker-registry under default project.
2. To enable the access to the registry, we need to create the route to do that click on “Create Route” and follow the screen as below:
After creation of External Route we can see it is a http endpoint to make it secure go to Applications -> Routes -> docker-registry.
Now from the command line can log into docker-registry, using the below command.
3. Execute the below commands to successfully log into the docker registry.
4. Now to push the builder image we have built, we need to create a image stream and then need to tag it.
Here, I’m using a already built Builder Image which i created during my previous blog.
Here, msa-ubuntu-builder is my Builder Image. Now we can execute the create image stream command.
After the creation of image stream we can see the below screen.
Then tag the image using the below command.
After a successful push, we can see that the image pushed successfully.
To make a push with a version, execute the below:
That’s it we are now successfully pushed our image to the openshift. In my next blog will continue this to explain about how we can create a S2I build and then deployment in openshift, using the builder image we have pushed here.