MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Openshift: Lab 4 – Install an application from a Linux container image using the oc CLI tool

What Lab 4 teaches

Lab 4 teaches how to use the oc CLI tool from a local machine to deploy an application on a remote OpenShift cluster from a Linux container image stored in a container image repository.

The sample image used is:

quay.io/rhdevelopers/greeter

The main deployment command in the PDF is:

oc new-app quay.io/rhdevelopers/greeter
Code language: JavaScript (javascript)

The expected output shows OpenShift creating:

imagestream.image.openshift.io "greeter" created
deployment.apps "greeter" created
service "greeter" created
Code language: CSS (css)

Then OpenShift says the application is not exposed and suggests:

oc expose service/greeter

Main lab flow

StepWhat the learner doesCommand / Action
1Open Developer Sandbox web consoleBrowser action
2Open command-line login pageQuestion mark → Command Line tools
3Display tokenClick Display Token
4Copy login commandCopy Log in with this token
5Log in from local terminalPaste the copied oc login --token=... --server=... command
6Deploy app from imageoc new-app quay.io/rhdevelopers/greeter
7Expose app externallyoc expose service/greeter
8Open app from TopologyClick external URL icon
9Check labelsoc get deployment --show-labels
10Delete app resourcesoc delete all -l app=greeter

Clean CLI version of Lab 4

# Log in using the token command copied from OpenShift web console
oc login --token=<your-token> --server=<your-api-server>

# Confirm login
oc whoami

# Check current project
oc project

# Deploy the app from a container image
oc new-app quay.io/rhdevelopers/greeter

# Check created resources
oc get all

# Expose the service as a route
oc expose service/greeter

# Get the route
oc get route greeter

# Open/test the app
curl -I http://$(oc get route greeter -o jsonpath='{.spec.host}')

# View deployment labels
oc get deployment --show-labels

# Delete all app resources by label
oc delete all -l app=greeter
Code language: PHP (php)

So yes, this lab is basically the CLI version of Lab 3, but it uses a different sample image: quay.io/rhdevelopers/greeter instead of the Lab 3 ParksMap image.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Azure Devops Pipeline YAML Example

This page shows a minimal Azure Pipelines YAML file that builds a Docker image with the Docker@2 task on a Microsoft-hosted Ubuntu agent each time code is…

Read More

Docker Tutorials: Docker Image – Example and Sample Programs of Dockerfile

This page collects sample Dockerfiles that build an Ubuntu-based Apache image and show how CMD, ENTRYPOINT, EXPOSE, ARG, ENV, COPY and USER behave. Below the examples you…

Read More

Kubernetes: Pull an Image from a Private Registry using Yaml and Helm File

Kubernetes pulls images from a private registry using a kubernetes.io/dockerconfigjson Secret. A Pod references that Secret through imagePullSecrets, either directly or through its ServiceAccount. This page shows…

Read More

Docker Training Agenda: A Hands-On Learning Path from Containers to Registries and Networking

This revised Docker training agenda turns the original outline into a practical, modern learning path for beginners and early-career DevOps engineers. It maps each module to hands-on outcomes, core commands, and common implementation decisions.

Read More

Install Sonatype Nexus with Docker: RM2/RM3 Commands, Validation Steps, and Important Caveats

A structured, production-minded rewrite of the original 2016 Docker setup for Sonatype Nexus Repository Manager 2 and 3. Includes command examples, a workflow diagram, and clear warnings about outdated tags/endpoints.

Read More

Virtualization in DevOps: Using Vagrant, Docker, and Cloud Platforms Together

This guide explains how VM-based workflows, containers, and cloud platforms complement each other in DevOps. It includes a practical workflow, trade-off table, and command examples for day-to-day use.

Read More
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Puja kushwaha
Puja kushwaha
1 month ago

Deploying an application from a container image with the oc CLI is a useful way to practice repeatable releases. Before deployment, teams should confirm the image source, tag, exposed port, and required environment settings. After the pod starts, checking logs and readiness helps catch startup problems early. It is also worth verifying that the service and route let users reach the application as expected. Using fixed image tags and keeping a rollback option ready makes future updates safer and easier to trace.

Skylar Bennett
Skylar Bennett
5 months ago

The guide covers the basics of deploying container images with the oc CLI well, but it would be worthwhile to address some day-to-day operational considerations. In production environments, teams typically rely on image signing, vulnerability scanning, and controlled promotion pipelines to strengthen security and traceability. It may also be helpful to discuss the benefits of immutable image references and deployment rollback procedures to ensure more predictable and resilient application updates.

2
0
Would love your thoughts, please comment.x
()
x