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.

What is Openshift S2I?


๐ŸŽฏ What is S2I?

S2I = Source-to-Image

โœ… Itโ€™s a build process invented by OpenShift (Red Hat) to automate:

“Take my source code + take a base image โ†’ and build a new runnable application container.”

You give it:

  • Source code (like HTML, PHP, Python app, Java code)
  • S2I base image (like nginx, nodejs, python builder image)

It gives you:

  • New container image that has both the code + runtime server inside.

๐Ÿ“ฆ What is an S2I Base Image?

An S2I base image is a special Docker container image that:

FeatureDescription
Has a web server, app server, or runtime pre-installede.g., nginx, nodejs, python
Has scripts inside (assemble, run)Helps OpenShift build a new app image automatically
Waits for your source codeYour app code is injected during build
Produces a new runnable imageCombining base + your code

โœ… S2I base images are made specially for OpenShift pipelines.

They are not meant to be directly run without building first.


๐Ÿง  Easy Example:

Imagine you want to deploy a static website:

Traditional WayS2I Way
You manually build Docker image (nginx + your site files)You push your HTML files to GitHub
You write Dockerfile yourselfOpenShift runs oc new-app nginx-s2i~your-git-repo
You manually build/push containerOpenShift builds everything automatically

โœ… Less work for you โœ… More automation for you


๐Ÿ“ข Example of S2I base images:

Base ImageLanguage/RuntimeUsage
registry.redhat.io/rhscl/nginx-116-rhel7nginxServe HTML sites
registry.redhat.io/rhscl/nodejs-14-rhel7Node.js 14Node.js apps
registry.redhat.io/rhscl/python-38-rhel7Python 3.8Python apps
registry.redhat.io/rhscl/php-73-rhel7PHP 7.3PHP apps

All these are S2I base images.


๐Ÿ“‹ How an S2I base image actually works inside:

It includes scripts like:

ScriptPurpose
assembleHow to copy your source code into the container and prepare the app
runHow to start the server when container runs
save-artifactsOptional, to cache dependencies

โœ… OpenShift uses these scripts automatically when you run oc new-app.

You donโ€™t have to write Dockerfiles manually!


๐Ÿš€ S2I Full Flow (Visual)

Your GitHub Repo (HTML / PHP / Python App)
          โ†“
+-------------------+
|  S2I Base Image    |
| (nginx, python)    |
+-------------------+
          โ†“
OpenShift S2I Process (BuildConfig)
          โ†“
New Image (runtime + your code together)
          โ†“
Pod runs your application!
Code language: PHP (php)

๐Ÿ”ฅ When to use S2I

Use S2I if…Reason
You have app source code (HTML, PHP, Node.js, Python, etc.)Easy auto-build
You don’t want to write Dockerfiles manuallySaves your time
You want to build and deploy faster inside OpenShiftAutomated pipelines

โœ… S2I is powerful especially for development workflows and CI/CD pipelines.


โœจ In one simple sentence:

S2I Base Image is a starting point container that expects your source code and creates a ready-to-run application image automatically inside OpenShift.


๐Ÿ›  Summary Table:

TermMeaning
S2ISource-to-Image build process
S2I Base ImagePre-built image waiting for your code
Used forAutomating app builds inside OpenShift
Needs Source Code?โœ… Yes
Runs directly as pod?โŒ No, needs build step first

๐Ÿš€ Practical Tip for You

ScenarioWhat to use
Want to run simple nginx server quicklyUse nginxinc/nginx-unprivileged
Want to build HTML app and serveUse rhscl/nginx-116-rhel7 as S2I

๐ŸŽฏ Running an S2I Base Image in OpenShift Cluster

โœ… Beginner-friendly
โœ… Realistic example
โœ… Works on OpenShift 4.x or later


๐Ÿ“ฆ S2I Tutorial Overview

We will:

StepTaskDescription
1Pick an S2I base imageExample: registry.redhat.io/rhscl/nginx-116-rhel7
2Prepare simple source codeHTML project on GitHub
3Create S2I app in OpenShiftUsing oc new-app
4Deploy and access appVia OpenShift Route

๐Ÿ›  Step 1: Pick an S2I Base Image

We will use:

registry.redhat.io/rhscl/nginx-116-rhel7

โœ… Itโ€™s an NGINX S2I builder (for serving static websites).


๐Ÿงฐ Step 2: Prepare Source Code (GitHub)

You need a GitHub repo with static website files (HTML/CSS).

Example ready-to-use repo:
โžก๏ธ https://github.com/sclorg/nginx-container/tree/master/1.16/test/test-app/

Or you can create your own repo like this:

  1. Create a new GitHub repo:
    Example: https://github.com/yourusername/my-s2i-nginx-app
  2. Add some simple index.html:
<!-- index.html -->
<html>
  <head><title>Welcome to S2I NGINX App</title></head>
  <body><h1>Hello from OpenShift + S2I!</h1></body>
</html>
Code language: HTML, XML (xml)

โœ… Push this file to GitHub.


๐Ÿš€ Step 3: Create S2I App in OpenShift

๐Ÿ‘‰ Login to your OpenShift cluster:

oc login https://your-openshift-cluster:6443
Code language: JavaScript (javascript)

๐Ÿ‘‰ Now create your S2I app:

oc new-app registry.redhat.io/rhscl/nginx-116-rhel7~https://github.com/yourusername/my-s2i-nginx-app --strategy=source
Code language: JavaScript (javascript)

โœ… What this command does:

  • Pulls base image nginx-116-rhel7
  • Pulls your source code from GitHub
  • Builds a new image combining both
  • Deploys a pod automatically

๐ŸŒ Step 4: Expose Route (to Access App)

Create a Route:

oc expose svc/my-s2i-nginx-app

โœ… Then get the URL:

oc get routes
Code language: JavaScript (javascript)

You’ll get something like:

http://my-s2i-nginx-app-yourproject.apps.cluster.example.com
Code language: JavaScript (javascript)

Open it in browser โ€”
โœจ You will see your HTML page served from the new OpenShift app!


๐Ÿ“‹ Full Commands Summary

# Login
oc login https://your-openshift-cluster:6443

# Create S2I app
oc new-app registry.redhat.io/rhscl/nginx-116-rhel7~https://github.com/yourusername/my-s2i-nginx-app --strategy=source

# (Optional) Watch build
oc logs -f bc/my-s2i-nginx-app

# Expose a Route
oc expose svc/my-s2i-nginx-app

# Get public URL
oc get routes
Code language: PHP (php)

๐Ÿ”ฅ Important Tips

ProblemSolution
error: cannot find source repositoryCheck GitHub URL is public
imagepullbackoffCheck cluster can pull Red Hat registry images (pull secret)
App not updating?Run oc start-build my-s2i-nginx-app --from-dir=. to rebuild manually

๐Ÿง  Visual Flow

GitHub Repo (HTML)
        โ†“
oc new-app (S2I build)
        โ†“
BuildConfig + ImageStream created
        โ†“
Pod created from new image
        โ†“
Service + Route exposed
        โ†“
Your app live on internet! ๐Ÿš€
Code language: JavaScript (javascript)

๐Ÿ† Final Quick Recap

StepAction
1Pick S2I builder (registry.redhat.io/rhscl/nginx-116-rhel7)
2Prepare GitHub repo (index.html)
3Run oc new-app with --strategy=source
4Expose service using Route

โœ… You now know how to run S2I base images in OpenShift!
โœ… This knowledge is essential for DevOps, OpenShift developers, CI/CD engineers.



Letโ€™s do a real complete project:
Youโ€™ll build your own HTML website,
then deploy it into OpenShift using S2I process.


๐ŸŽฏ Project Goal

StepAction
1Create a simple HTML website
2Push the website to GitHub
3Deploy it into OpenShift using S2I base image
4Access your site via OpenShift Route

๐Ÿ›  Step 1: Create Your Own HTML Website

On your local machine, create a project:

mkdir my-openshift-website
cd my-openshift-website

Now create a simple index.html:

<!-- my-openshift-website/index.html -->
<html>
<head>
    <title>Welcome to My OpenShift Website</title>
</head>
<body>
    <h1>Hello World from Rajesh! ๐Ÿš€</h1>
    <p>Running on OpenShift with S2I magic!</p>
</body>
</html>
Code language: HTML, XML (xml)

โœ… Done โ€” your website is ready.


๐ŸŒ Step 2: Push Your Website to GitHub

Initialize Git and push:

git init
git add .
git commit -m "Initial commit - my openshift html site"
git branch -M main
git remote add origin https://github.com/yourusername/my-openshift-website.git
git push -u origin main
Code language: JavaScript (javascript)

โœ… Now your project is live at:

https://github.com/yourusername/my-openshift-website
Code language: JavaScript (javascript)

(Public GitHub repo needed for OpenShift to pull.)


๐Ÿš€ Step 3: Deploy to OpenShift Using S2I

โœ… Login to your OpenShift cluster:

oc login https://your-openshift-cluster:6443
Code language: JavaScript (javascript)

โœ… Now run S2I Deployment:

oc new-app registry.redhat.io/rhscl/nginx-116-rhel7~https://github.com/yourusername/my-openshift-website --strategy=source
Code language: JavaScript (javascript)

โœ… OpenShift will:

  • Pull NGINX S2I base image (rhscl/nginx-116-rhel7)
  • Pull your HTML website from GitHub
  • Build a new container image
  • Deploy a Pod automatically

โœ… Watch the build logs (optional):

oc logs -f bc/my-openshift-website

๐ŸŒ Step 4: Expose your app with a Route

โœ… Create a Route:

oc expose svc/my-openshift-website

โœ… Get the public URL:

oc get routes
Code language: JavaScript (javascript)

Youโ€™ll get something like:

http://my-openshift-website-myproject.apps.cluster.example.com
Code language: JavaScript (javascript)

โœ… Open this URL in browser!

๐ŸŽ‰ Youโ€™ll see:

Hello World from Rajesh! ๐Ÿš€
Running on OpenShift with S2I magic!
Code language: JavaScript (javascript)

โœ… Your custom HTML website is now live on OpenShift! ๐ŸŒŸ


๐Ÿ“‹ Full Commands Summary (Cheat Sheet)

# 1. Create HTML site
mkdir my-openshift-website && cd my-openshift-website
# (create index.html)

# 2. Push to GitHub
git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/yourusername/my-openshift-website.git
git push -u origin main

# 3. Deploy to OpenShift
oc login https://your-openshift-cluster:6443
oc new-app registry.redhat.io/rhscl/nginx-116-rhel7~https://github.com/yourusername/my-openshift-website --strategy=source

# 4. Watch build (optional)
oc logs -f bc/my-openshift-website

# 5. Expose
oc expose svc/my-openshift-website

# 6. Get URL
oc get routes
Code language: PHP (php)

๐Ÿง  Visual Architecture

Your GitHub Repo (index.html)
         โ†“
S2I Build Process (oc new-app)
         โ†“
BuildConfig + ImageStream
         โ†“
New Container Image Created
         โ†“
Pod Running + Service
         โ†“
Route Created
         โ†“
Public Website LIVE ๐Ÿš€
Code language: PHP (php)

๐Ÿ“ข Key Points to Remember

TopicTip
Base Imageregistry.redhat.io/rhscl/nginx-116-rhel7
Strategy--strategy=source
Code LocationPublic GitHub repo
Exposing serviceUse oc expose svc/<service-name>
Cluster pull secretsMust be able to pull Red Hat registry images

๐Ÿ† Now you know how to:

โœ… Create your own HTML app
โœ… Deploy it into OpenShift using S2I
โœ… Access it publicly over internet
โœ… Automate build from GitHub source
โœ… Master basic OpenShift developer workflow ๐Ÿš€


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

Terraform Backend Tutorial

Terraform is a popular open-source infrastructure as code tool used to create and manage infrastructure resources. The state of the infrastructure resources managed by Terraform is stored…

Read More

Best Tools for Software Composition Analysis (SCA)

Hereโ€™s a clear and professional explanation of the three related concepts you asked about โ€” all of which are critical parts of secure software development, especially in…

Read More

Top 10 AI Code Review Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI code review tools have become essential for developers aiming to enhance code quality, streamline workflows, and accelerate software delivery. These tools leverage advanced…

Read More

Top 10 Expense Management Tools in 2026: Features, Pros, Cons & Comparison

Introduction Expense management tools are critical for businesses of all sizes in 2026 as they help streamline financial processes, improve budgeting, ensure compliance, and enhance financial visibility….

Read More

Top 10 Web Application Firewall (WAF) Tools in 2026: Features, Pros, Cons & Comparison

Introduction In the rapidly evolving landscape of cybersecurity, Web Application Firewalls (WAFs) have become a critical component in defending web applications from malicious attacks such as SQL…

Read More

Top 10 Endpoint Management Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, businesses of all sizes are increasingly reliant on a variety of devicesโ€”laptops, desktops, mobile devices, and other endpointsโ€”that connect to their networks. With the…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x