Chapter 6. Custom Image Builds

In OpenShift a running application is simply one or more container images running in a pod. The mechanism by which the application is packaged into a runnable container image is called an image build.

OpenShift Builds

In OpenShift a build is the name given to the process of building a runnable container image.

The build process is concerned with extracting the application’s source or binary artifacts from some source, compiling the code if required, and layering the runtime artifact onto a base image to run it.

Once built, the container image is uploaded to the OpenShift registry to be used in the deployment process.

Build Strategies

A build strategy is the approach used to build the runtime image.

OpenShift supports a number of build strategies:

Source-to-Image (S2I)

The S2I uses the open source S2I tool to enable developers to reproducibly build images by layering the application’s source or binary artifacts onto a container image. The developer has to provide the location of the artifact and the builder image to use.

Docker

The Docker strategy allows developers to build images by providing a Dockerfile containing Docker directives.

Pipeline

The Pipeline strategy uses the open source Jenkins continuous integration platform to build container images. The developer provides a Jenkinsfile containing the requisite build commands.

Custom

The custom strategy allows the developer to provide a customized builder image to build the runtime image. ...

Get DevOps with OpenShift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.