Chapter 6. Building and Deploying from Source

When you deploy a pre-existing container image, if this is your own image, it means you needed to have separate tooling available to construct that image. You also had to upload the image to an image registry from which OpenShift could pull it down, or push the image into the internal image registry of OpenShift.

To simplify the release management process for an application, OpenShift provides the ability to build the image for you. You would use this when you want to automate the complete workflow, including the building of the image, any testing of the image, and then deployment.

OpenShift provides four different build strategies:


This uses Source-to-Image to produce ready-to-run images by injecting application source (or other assets) into a builder image.


This uses docker build to take a Dockerfile and associated source files and create a runnable image.


This uses Jenkins and a workflow defined by a Jenkinsfile to create a pipeline for building a runnable image.


This uses your own custom image to control the build process for creating the runnable image.

In this chapter you will learn how to use the Source build strategy to build and deploy an application from source code in a hosted Git repository, or source code pushed into OpenShift from your local computer.

Details of how to use the Docker build strategy will be covered in Chapter 7. However, this book will not go into the last two build ...

Get Deploying to OpenShift now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.