What is the difference between Builder and Runtime images in Red Hat Container Catalog ?

Solution Verified - Updated

Environment

  • OpenShift Container Platform
  • Red Hat Container Catalog

Issue

What is the difference between Builder and Runtime images in Red Hat Container Catalog ?

Resolution

Summary

TypeMeaningPorpuse
Builder imagelarger, will contain the complete systems adequate for S2IBuilder image is to build the application
Runtime imagesmaller, compact without all subsystems OCP deploymentRuntime image is to run the application

Details below:

  • Builder Images:

The Builder image as the name implies is to build your application.
These are a specialized form of container image which produce application container images as offspring. They include everything but a developer's source code. Builder images include operating system libraries,language runtimes, middleware, and the source-to-image tooling.

When a builder image is run, it injects the developers source code and produces a ready-to-run offspring application container image. This newly created application container image can then be run in development or production.

For example, if a developer has PHP code and they want to run it in a container, they can use a PHP builder image to produce a ready to run application container image. The developer passes the GitHub URL where the code is stored and the builder image does the rest of the work for them. The output of a Builder container is an Application container image which includes Red Hat Enterprise Linux, PHP from Software Collections, and the developer’s code, all together, ready to run.

Please check link for more information: This content is not included.Builder Image

  • Runtime Images:

The Runtime image as the name implies is to run your application.
Red Hat Software Collections offers another set of container images that you can use as the basis for your container builds. These images are built on RHEL standard base images, with some already updated as UBI images. Each of these images include additional software you might want to use for specific runtime environments. The runtime image can be tagged as Intermediary image, so top left corner of the image catalog details.

Runtime images are used for running built software.

Please check this documentation for more information: Runtime Image

Root Cause

OpenJDK runtime vs OpenJDK builder image

EAP and OpenJDK have two types of images: the builder image and the runtime image - the buider image tag it is at the top left corner on the Red Hat Catalog Portal.

ImageTypePurpose
This content is not included.ubi/openjdk11 - builderBuilderSource To Image (S2I) image for Red Hat OpenShift providing OpenJDK 11
This content is not included.ubi/openjdk11 - runtimeRuntimeImage for Red Hat OpenShift providing OpenJDK 11 runtime

As the technical page of buider image explains, This content is not included.OpenJDK 11 S2I for OCP 4, the S2I is for the builder image - the runtime image doesn't have this link.

That's because S2I needs to do the building process, and there are no javac or maven packages in the runtime image. Also no /usr/local/s2i/assemble or run scripts as well. One alternative is to use a builder image and then specifying a "runtime image" to layer the build artefacts into, different from the builder - this process is Content from github.com is not included.OCP S2I runtime image.

Components
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.