
An image is basically an object that can be used to deploy an operating system to an OpenShift container, such as a Linux Red Hat operating system. These are typically small, lightweight operating systems that just contain the core features needed to run the operating system in an OpenShift container. Often, images come precompiled with certain features. For example, a Python image would contain the requirements needed to run a Python application in the container. A Node.js image would contain the requirements needed to run a Node.js application in the container.
A deployment includes a certain image and the deployment creates a replica set (which is the number of pods that should be created) and then the replica set should spawn pods, and each pod should include a container. The container runs the operating system.
The oc get imagestreams command can be used to list the image streams in your currently selected project / namespace. Notice in this example that the s2i-python-container image stream does not contain any TAGS.
~]$ oc get imagestreams --namespace my-project
NAME IMAGE REPOSITORY TAGS UPDATED
imagestream.image.openshift.io/python-39 image-registry.openshift-image-registry.svc:5000/my-project/python-39 latest 8 months ago
imagestream.image.openshift.io/s2i-python-container image-registry.openshift-image-registry.svc:5000/my-project/s2i-python-container
The oc get imagetags command can be used to list the image tags. Notice in this example that only the python-39 image stream contains a tag and the s2i-python-container image is not listed.
~]$ oc get imagetags --namespace my-project
NAME SPEC STATUS HISTORY UPDATED
python-39:latest Tag image/sha256:ee88016114c97dae2849195f1b0e94f65bd6cfe823ce569b9b0c6097296cdcf0 1 8 months ago
python-39:v4.7.0-202205312157.p0.g7706ed4.assembly.stream Tag image/sha256:ee88016114c97dae2849195f1b0e94f65bd6cfe823ce569b9b0c6097296cdcf0 1 8 months ago
The oc tag command can be used to TAG an image stream. In this example, the 2i-python-container image stream is tagged "latest".
~]$ oc tag imagestream.image.openshift.io/s2i-python-container s2i-python-container:latest
Tag s2i-python-container:latest set to imagestream.image.openshift.io/s2i-python-container.
Now the s2i-python-container image stream has a tag.
~]$ oc get imagestreams --namespace my-project
NAME IMAGE REPOSITORY TAGS UPDATED
imagestream.image.openshift.io/python-39 image-registry.openshift-image-registry.svc:5000/my-project/python-39 latest 8 months ago
imagestream.image.openshift.io/s2i-python-container image-registry.openshift-image-registry.svc:5000/my-project/s2i-python-container latest 10 seconds ago
~]$ oc get imagetags --namespace my-project
NAME SPEC STATUS HISTORY UPDATED
python-39:latest Tag image/sha256:ee88016114c97dae2849195f1b0e94f65bd6cfe823ce569b9b0c6097296cdcf0 1 8 months ago
python-39:v4.7.0-202205312157.p0.g7706ed4.assembly.stream Tag image/sha256:ee88016114c97dae2849195f1b0e94f65bd6cfe823ce569b9b0c6097296cdcf0 1 8 months ago
s2i-python-container:latest Tag image/sha256:d4e20aa826660f635fad77837b9c6aab8248f0560cd8c3c2283c12704359e9bb 1 10 seconds ago
s2i-python-container:v4.7.0-202505210151.p0.g7706ed4.assembly.stream Tag image/sha256:d4e20aa826660f635fad77837b9c6aab8248f0560cd8c3c2283c12704359e9bb 1 10 seconds ago
Did you find this article helpful?
If so, consider buying me a coffee over at