liveBook · Manning

S2i

As explained in Developer Experience on Kubernetes

The source-to-image pattern builds a production-ready container image directly from application source code without requiring developers to author a Dockerfile or manage underlying build details.

Source-to-image is a containerization pattern that turns application source code into a production-ready container image in one operation. Developers provide source; the build tool handles containerization details, so no Dockerfile is required. section 3.2.2 section 3.5

Figure 3.5 Source-to-Image, a pattern for going from application source code to container image in one single operation and with no Dockerfile.

The pattern reduces the path from application source to a container image to a single build operation. section 3.2.2

The pattern separates developer work from platform containerization responsibilities:

  • Developers supply application source code rather than a Dockerfile or low-level container instructions. section 3.2.2
  • A CLI, service, or library builds the image and applies container performance, security, and compliance practices. section 3.2.2
  • Platform teams can offer containerization as a service and enforce consistent security and compliance across generated images. section 3.2.2

Cloud Native Buildpacks and ko implement this pattern differently. Buildpacks uses a builder OCI image containing ordered buildpacks for concerns such as the operating system, certificates, language runtime, and SBOM generation. ko targets Go applications, supports CLI and library use, and provides layered, multi-architecture builds with a customizable base image. section 3.2.3 section 3.2.4

Packaging an application

Buildpacks can package the Appointments service with `pack build appointments:0.0.1-SNAPSHOT`; Spring Boot can use its built-in Buildpacks integration. For the Go version, `ko build --local -B -t 0.0.1-SNAPSHOT` creates a local image that can run with the included Podman Compose setup alongside PostgreSQL. section 3.2.3 section 3.2.4

How Developer Experience on Kubernetes covers it

How deep it goes
Defines the pattern and contrasts Buildpacks and ko while deferring underlying containerization details to the selected tool.
Examples
Demonstrates packaging the Appointments service with Pack, Spring Boot Buildpacks integration, and ko before running it with Podman Compose.
What it assumes
Assumes application source and a container-image workflow while removing the need for Dockerfile expertise.
What you can do after
Apply it via Pack, Spring Boot Buildpacks integration, or ko to package source without authoring Dockerfiles.
How it connects
Connects Dockerfiles, OCI images, Cloud Native Buildpacks, ko, SBOMs, and Kubernetes inner-loop workflows.

Also explained in

Compare how 2 books explain s2i →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Developer Experience on Kubernetes. The section links point to the parts of the book it draws on.