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

