Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Best DevOps Tools in 2024

here’s a clear, structured breakdown of the Best DevOps Tools (grouped by categories), so you can use it for learning, training, or posts. 🚀 Best DevOps Tools…

Read More

OpenShift Tutorial – Deploy and Access Your First Applications using OpenShift Local

How to install oc? OpenShift: How to Install OpenShift CLI oc How to login? Login to the Openshift using Web Console and CLI using oc Copy the admin…

Read More

OpenShift Lab 14: Setting Up and Using OpenShift Serverless Functions on OpenShift Local

Lab Objective In this lab, you will install and use OpenShift Serverless Functions on OpenShift Local. You will create a simple Node.js serverless function, deploy it to…

Read More

OpenShift Lab 13: Deploy a Java Spring Boot Application with MySQL Using the OpenShift Web Console

Lab Objective In this lab, you will deploy a Java Spring Boot application on OpenShift using the OpenShift web console. You will deploy two components: The Java…

Read More

OpenShift Lab 12: Deploy an Application from an Existing Container Image Using the OpenShift Web Console

Lab Objective In this lab, you will deploy an application on OpenShift from an existing container image. This lab is different from building an application from source…

Read More

OpenShift: How to Install OpenShift CLI oc

Option – 1 – REDHAT Websites URL – https://access.redhat.com/downloads/content/290/ver=4.18/rhel—9/4.18.11/x86_64/product-software Option – 2 – OKD Websites The OKD (Origin Community Distribution of Kubernetes for OpenShift) is the open-source…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Skylar Bennett
Skylar Bennett
18 days 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.

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