Skip to main content
In this lesson we cover OpenShift build and deployment concepts: BuildConfig, ImageStream, builds (S2I/Docker/Custom), and DeploymentConfig. You’ll learn how OpenShift converts application source from a Git repository into an image, tracks that image with an ImageStream, and deploys it automatically.
A Red Hat OpenShift title slide with large "OPENSHIFT" text over a pink-to-purple gradient background. The subtitle reads "SCM, Builds and Deployments in OPENSHIFT."
Prerequisites
  • Familiarity with Docker: what an image is and how to build one from source. See Docker basics.
  • Basic OpenShift project (namespace) knowledge — how to create and switch projects. If needed, review OpenShift project creation first.
Where is the application? OpenShift builds from application source stored in a source code management (SCM) repository such as GitHub, GitLab, or Bitbucket. When you add an application to OpenShift (via Web Console or CLI), you provide the repository URL. Example:
How OpenShift builds and deploys an application When you add an application and point to a Git repo, OpenShift performs a sequence of automated steps:
  1. Create BuildConfig (and start a Build) using the repository URL and chosen build strategy.
  2. Clone the repository inside a build pod.
  3. Build the application into a container image (S2I, Docker, or Custom strategy).
  4. Push the resulting image to the internal OpenShift image registry.
  5. Create (or update) an ImageStream to track the image.
  6. Create a DeploymentConfig (by default) that references the ImageStream.
  7. On image push, an image change trigger fires and the DeploymentConfig deploys the new image.
Key concepts and links
  • BuildConfig: controls how builds are run and triggered.
  • ImageStream: a reference to images in the OpenShift internal registry; used to trigger deployments.
  • DeploymentConfig: OpenShift object for managing rollouts with OpenShift-specific triggers and hooks.
  • Source-to-Image (S2I): S2I is a common builder for language runtimes. Learn more at S2I.
Ensure your Git repository is reachable from the cluster network. If the repo is private, configure credentials (Secrets) in OpenShift and reference them from the BuildConfig before starting the build.
A sample build output This excerpt shows the build lifecycle: cloning the repo, installing dependencies, collecting static files, and pushing the built image to the internal registry.
Deployment objects: OpenShift vs Kubernetes OpenShift provides a deployment object with OpenShift-specific features. For comparison:
Both types manage pods and rollouts, but DeploymentConfig adds OpenShift features such as image change triggers and lifecycle hooks that integrate directly with ImageStreams. Comparison summary How triggers work
  • ImageStream update → Image change trigger on DeploymentConfig → New rollout using the pushed image.
  • BuildConfig completion can also trigger deployments when configured.
Quick CLI commands for builds and deployments
  • Start a build (example using S2I/push):
  • List builds:
  • View build logs:
  • Watch DeploymentConfig rollouts:
Summary When you add an application and point OpenShift to a Git repository:
  • OpenShift creates a BuildConfig and starts a build.
  • The build clones the repository and builds the application (S2I, Docker, or Custom).
  • The build produces a container image and pushes it to the internal registry.
  • An ImageStream surfaces the image and, by default, a DeploymentConfig is created and triggered to deploy the updated image.
A slide titled "Deployment" that shows a five-step pipeline from a GitHub repo through build/download, image build and push to a Docker registry, to deployment, with numbered red labels and icons.
Demo: add an application and observe the flow Follow these steps to see builds and deployments in action:
  1. Create or switch to a project:
  1. Add the application (example):
  1. Check builds:
  1. Check ImageStreams and DeploymentConfig:
  1. Watch the rollout:
References Let’s go through the demo and observe the build, image push, ImageStream update, and automatic deployment in your cluster.

Watch Video