Get your DockerHub Image to OpenShift ImageStream
OpenShift uses the concept of ImageStream. ImageStream comprises of one or more Docker images identified by tags.
While deploying an image in OpenShift we generally get 2 options.
1. Deploy from ImageStream.
2. Deploy image from private respository.

Here i am going to choose Deploy from ImageStream. Then, I choose my project name for namespace. But when i click on ImageStream, I do not have anything to select here. This is because we do not have any images in our ImageStream.
Below I will show, how we can tag an image from DockerHub to OpenShift ImageStream.
First we need to go to the project, below command will set the context to your project
oc project <Your-Project>
OpenShift has a command “tag” like docker tag, which we can use to tag our existing image to ImageStream.
oc tag --source=docker <DockerHubUser>/<DockerImage>:<Tag> <ImageName>:<Tag>
In the above command we are instructing OC that source is the docker image from DockerHub repository. Destination is the name of image in ImageStream.
Once this is done, You can check that your image is in ImageStream using following command.
oc get is
Now, when you try to Deploy Image, the ImageStream dropdown will have the “codesnip” option for you to choose. Just select the image, enter the tag you used in the above command and click Deploy! You are good to go!
First published on my old blog, Write Code. Be Agile. Go DevOps.