
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.
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
The oc get images command will list the images that have been imported into your OpenShift cluster. The oc import-image command can be used to import an image into your OpenShift cluster.
In this example, there are a few images.
- nginx version 118 for Red Hat Enterprise Linux 8 (RHEL8)
- Python version 3.11
- Node.js version 20
- JBoss Enterprise Application Platform (EAP) version 7.4
~]# oc get images
NAME IMAGE REFERENCE
sha256:b0c3c1535819ebbc8fe00b79cd74d88702d1bd74a5348a30b2fa849a637ecac6 registry.redhat.io/rhel8/nginx-118@sha256:b0c3c1535819ebbc8fe00b79cd74d88702d1bd74a5348a30b2fa849a637ecac6
sha256:47107ded2aac95702535be963e2718e58d45bcecb3d4e582bd58bd35f6fc6bc3 registry.redhat.io/ubi9/python-311@sha256:47107ded2aac95702535be963e2718e58d45bcecb3d4e582bd58bd35f6fc6bc3
sha256:df6182b6f617306dd8d249c31c1ce5822b80160f511e040b348d92b66b170432 registry.redhat.io/ubi9/nodejs-20@sha256:df6182b6f617306dd8d249c31c1ce5822b80160f511e040b348d92b66b17043
sha256:402bd15674def5025ab2900ad013e4360ef99d21e7728f5d391b27de042ecb0f registry.redhat.io/jboss-eap-7/eap74-openjdk11-openshift-rhel8@sha256:402bd15674def5025ab2900ad013e4360ef99d21e7728f5d391b27de042ecb0f
The same SHA256 digest for version 118 of the NGINX image can be seen at https://catalog.redhat.com, which lists the images stored in the registry.redhat.io online repository.
The oc describe image command can be used to display more information about an image.
~]# oc describe image sha256:0089883f8e4387618946cd24378a447b8cf7e5dfaa146b94acab27fc5e170a14
Docker Image: registry.redhat.io/jboss-webserver-3/webserver31-tomcat7-openshift@sha256:19b41b58dd04cff1fee28176781bf3243fc140d54a0a0f010843a5fc61557536
Name: sha256:19b41b58dd04cff1fee28176781bf3243fc140d54a0a0f010843a5fc61557536
Created: 13 months ago
Annotations: image.openshift.io/dockerLayersOrder=ascending
Image Size: 195.9MB in 6 layers
Layers: 74.87MB sha256:26e5ed6899dbf4b1e93e0898255e8aaf43465cecd3a24910f26edb5d43dafa3c
1.238kB sha256:66dbe984a319ca6d40dc10c2c561821128a0bd8967e0cbd8cc2a302736041ffb
3.639MB sha256:78f9ea175a0a36eeccd5399d82c03146149c4d6ad6afa134cb314c7d3be7dab9
70.07MB sha256:39fe8b1d3a9cb13a361204c23cf4e342d53184b4440492fa724f4aeb4eb1d64f
12.97MB sha256:9a6c965879c0d9c02d9fbcf8d55930a40b7ca790ad568755d4f6060809d004aa
34.38MB sha256:f1c49b6f75bca53ff3885a83e79cfd6521979158d2f2993243e09a4aa6019a05
Image Created: 4 years ago
Author: <none>
Arch: amd64
Command: /opt/webserver/bin/launch.sh
Working Dir: /home/jboss
User: 185
Exposes Ports: 8080/tcp, 8443/tcp, 8778/tcp
Docker Labels: architecture=x86_64
authoritative-source-url=registry.access.redhat.com
build-date=2017-10-23T14:39:59.620549
com.redhat.build-host=rcm-img-docker02.build.eng.bos.redhat.com
com.redhat.component=jboss-webserver-3-webserver31-tomcat7-openshift-docker
com.redhat.deployments-dir=/opt/webserver/webapps
com.redhat.dev-mode=DEBUG:true
com.redhat.dev-mode.port=JPDA_ADDRESS:8000
description=Platform for building and running web applications on JBoss Web Server 3.1 - Tomcat v7
distribution-scope=public
io.k8s.description=Platform for building and running web applications on JBoss Web Server 3.1 - Tomcat v7
io.k8s.display-name=JBoss Web Server 3.1
io.openshift.expose-services=8080:http
io.openshift.s2i.scripts-url=image:///usr/local/s2i
io.openshift.tags=builder,java,tomcat7
maintainer=Cloud Enablement Feedback <cloud-enablement-feedback@redhat.com>
name=jboss-webserver-3/webserver31-tomcat7-openshift
org.jboss.deployments-dir=/opt/webserver/webapps
release=12
summary=Red Hat JBoss Web Server 3.1 Tomcat 7 container image
url=https://access.redhat.com/containers/#/registry.access.redhat.com/jboss-webserver-3/webserver31-tomcat7-openshift/images/1.0-12
vcs-ref=2a22ef4bf95ebeaa881da765f81a329146b77e08
vcs-type=git
vendor=Red Hat, Inc.
version=1.0
Environment: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
container=oci
JBOSS_IMAGE_NAME=jboss-webserver-3/webserver31-tomcat7-openshift
JBOSS_IMAGE_VERSION=1.0
HOME=/home/jboss
JAVA_TOOL_OPTIONS=-Duser.home=/home/jboss -Duser.name=jboss
JAVA_HOME=/usr/lib/jvm/java-1.8.0
JAVA_VENDOR=openjdk
JAVA_VERSION=1.8.0
JBOSS_PRODUCT=webserver
JBOSS_WEBSERVER_VERSION=3.1.1
PRODUCT_VERSION=3.1.1
TOMCAT_VERSION=7.0.70
JWS_HOME=/opt/webserver
CATALINA_OPTS=-Djava.security.egd=file:/dev/./urandom
JPDA_ADDRESS=8000
STI_BUILDER=jee
AB_JOLOKIA_PASSWORD_RANDOM=true
AB_JOLOKIA_AUTH_OPENSHIFT=true
AB_JOLOKIA_HTTPS=true
Or, the oc get image command with the --output json or --output yaml option can be used.
oc get image sha256:19b41b58dd04cff1fee28176781bf3243fc140d54a0a0f010843a5fc61557536 --output yaml
Did you find this article helpful?
If so, consider buying me a coffee over at