Where Buildpacks Fit in Cloud-Native Build Automation
How Cloud Native Buildpacks build OCI images without Dockerfiles: builders, lifecycle phases, pack CLI, rebase, SBOMs and where they fit in CI/CD.
Buildpacks fit at the image-build step of a cloud-native pipeline, where they replace hand-written Dockerfiles. Cloud Native Buildpacks inspect your source code, pick the right language runtime and dependencies, and produce a standard OCI image. They suit teams running many similar services that want consistent, patchable images without every team maintaining its own Dockerfile.
This guide explains how Cloud Native Buildpacks work, where they sit in CI/CD, how to use the pack CLI and when a Dockerfile is still the better choice. It is part of our CI/CD cluster. If containers are new to you, start with what Docker is and why it is popular.
Key takeaways
- Cloud Native Buildpacks (CNB) turn source code into OCI images without a Dockerfile. The project moved to CNCF Graduated status on 17 July 2026.
- A builder image bundles an ordered set of buildpacks, the lifecycle binary and references to build and run base images.
- The lifecycle runs phases including detect, analyze, restore, build and export; the creator runs them together in one command.
- Rebase swaps in a newer run base image without rebuilding the app, which makes operating system patching fast across many images.
pack sbom downloadextracts a software bill of materials in CycloneDX, SPDX or Syft format from a built image.- Paketo moved its main builder to
paketobuildpacks/ubuntu-noble-builderin October 2025, replacing the Jammy builders.
The problem buildpacks solve
Dockerfiles give each team full control, and that control has a cost. In an organization with fifty services, you tend to get fifty slightly different Dockerfiles: different base images, different ways of installing dependencies, some running as root, some with build tools left in the final image. When a vulnerability appears in the base operating system, someone has to find and update every one of them.
Buildpacks move those decisions to a central place. A platform team chooses a builder, and every service built with it gets the same base images, the same dependency handling and the same image layout. Application developers push code; the builder decides how to package it. The project's own site describes the benefits in terms of balanced control between app developers and operators, compliance, and upgrades with minimal effort.
Core concepts
| Concept | What it is |
|---|---|
| Buildpack | Software that inspects source code and decides how to turn it into runnable artifacts, for example by installing a JDK and running Maven |
| Builder | An OCI image bundling an ordered set of buildpacks, a build-time base image, the lifecycle and a reference to a runtime base image |
| Lifecycle | The program that runs buildpacks in phases and assembles the final image |
| Build image and run image | The base image used while building, and the smaller base the final app runs on |
| Platform | The tool that runs the lifecycle, such as the pack CLI, kpack on Kubernetes or a CI integration |
| Rebase | Updating an app image to a newer run image without rebuilding |
How a build works
The lifecycle runs the build in phases. The buildpacks documentation describes them as follows:
- Detect selects an ordered group of buildpacks that apply to the source code. A Java buildpack looks for a
pom.xmlor Gradle file; a Node.js buildpack looks forpackage.json. - Analyze restores files that help speed up the build and export phases, such as metadata from a previous image.
- Restore copies cached layers into the build container so buildpacks can reuse them.
- Build runs the selected buildpacks to turn source code into runnable artifacts.
- Export assembles the final OCI image and updates its config metadata.
The creator runs all of these in one command and is used when the builder is trusted. At run time, the launcher is the image's entrypoint and starts the application processes. An extend phase applies Dockerfiles produced by image extensions, for cases where a buildpack needs to change the base image itself.
Because each buildpack writes its output to separate layers, unchanged layers such as a downloaded JDK or a node_modules directory can be reused from cache. That keeps rebuilds fast when only application code changes.
Building an image with pack
The pack CLI is the project's reference platform. A build needs an app path, an image name and a builder. Using Paketo's current Ubuntu Noble builder:
# Build an image from the current directory
pack build registry.example.com/team/orders-api:1.4.0 \
--path . \
--builder paketobuildpacks/ubuntu-noble-builder
# Set a default builder so you can omit --builder
pack config default-builder paketobuildpacks/ubuntu-noble-builder
# Build and push straight to a registry
pack build registry.example.com/team/orders-api:1.4.0 --publish
Paketo's October 2025 restructuring post lists paketobuildpacks/ubuntu-noble-builder as the replacement for builder-jammy-base, and paketobuildpacks/builder-noble-java-tiny as the replacement for the Jammy Java tiny builder. Teams still on Jammy builders should plan the switch and test it.
Configuring a build with project.toml
A project.toml file in the repository sets build-time environment variables and excludes files from the build context. The buildpacks documentation uses schema version 0.2:
[_]
schema-version = "0.2"
id = "com.example.orders-api"
name = "Orders API"
[io.buildpacks]
exclude = [
"README.md",
"docs/"
]
[[io.buildpacks.build.env]]
name = "BP_JVM_VERSION"
value = "21"
Variable names such as BP_JVM_VERSION are defined by each buildpack, not by the CNB specification, so check the documentation of the buildpack you use. If the file has a different name, pass it with --descriptor.
Where buildpacks sit in a CI/CD pipeline
- Developer pushes code; CI checks out the commit.
- Unit tests and static analysis run as usual.
- The buildpacks step builds the image, replacing
docker build. - The pipeline extracts the SBOM, scans the image and signs it.
- The image is pushed to a registry and its digest is written into deployment manifests.
- A GitOps controller or deploy job rolls it out.
The buildpacks documentation lists several CI integrations: pack itself, kpack (a Kubernetes-native build service), a CircleCI orb, GitLab Auto DevOps, SAP's Project Piper for Jenkins, and a Tekton task that uses the lifecycle directly. On any CI system that can run a container, you can also run pack in a job.
A GitLab CI job using pack might look like this. Adjust the image, registry login and variables to your setup:
build-image:
stage: build
image: buildpacksio/pack:latest
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- pack build "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
--builder paketobuildpacks/ubuntu-noble-builder
--publish
Pin the pack image and the builder to specific versions or digests in production pipelines so builds are repeatable. For more pipeline patterns, see 15 GitLab CI/CD pipeline examples.
Patching at scale with rebase
Rebase is the feature that most often convinces platform teams. When the run base image gets an operating system security fix, pack rebase updates the app image's layer metadata to point at the newer base image version. It does not rebuild the application, so it takes seconds per image instead of a full build.
# Rebase an image in a registry onto the latest run image
pack rebase registry.example.com/team/orders-api:1.4.0 --publish
With dozens or hundreds of services, a scheduled job that rebases every image after a base image update, followed by a normal rollout, closes operating system vulnerabilities much faster than editing each Dockerfile. Run your tests against the rebased image before production, as you would for any change.
Supply chain benefits
Buildpacks make it easier to know what is inside an image. The pack sbom download command writes the image's SBOM files to a local layers/sbom directory, in CycloneDX (sbom.cdx.json), SPDX (sbom.spdx.json) or Syft (sbom.syft.json) format, depending on what the buildpacks produced. Add --remote to read from a registry image.
pack sbom download registry.example.com/team/orders-api:1.4.0 --remote
Feed that SBOM into vulnerability scanning and keep it with the release record. Combine it with image signing and provenance for a fuller picture; see how SBOMs support DevOps compliance and securing a CI/CD pipeline against supply chain attacks.
Buildpacks compared with Dockerfiles
| Factor | Buildpacks | Dockerfile |
|---|---|---|
| Who decides how to build | Builder maintainers (platform team or community) | Each application team |
| Consistency across services | High by default | Depends on discipline and templates |
| OS patching | Rebase without rebuild | Rebuild every image |
| SBOM | Produced by buildpacks, downloadable with pack | Needs a separate tool |
| Custom system packages | Harder; needs extensions or a custom buildpack | Easy, one RUN line |
| Unusual stacks | Only if a buildpack exists | Anything you can script |
| Learning curve for developers | Low for supported languages | Moderate; many ways to get it wrong |
If you stay with Dockerfiles, the common pitfalls are listed in 15 mistakes in Dockerfile writing.
When buildpacks are not the right fit
- Applications that need unusual system libraries, kernel modules or a custom operating system setup.
- Languages or frameworks with no maintained buildpack.
- Very small images built from scratch, such as a single static Go binary, where a short multi-stage Dockerfile is simpler.
- Teams that need byte-for-byte control over every layer for regulatory reasons and already have a hardened Dockerfile process.
Many organizations use both: buildpacks as the default for standard web services, and Dockerfiles for the exceptions.
Running buildpacks on Kubernetes
kpack, maintained under the Buildpacks Community, runs builds inside Kubernetes as custom resources. It can watch source repositories and builder images, rebuild when either changes and rebase images when a new run image appears. That suits platform teams building an internal developer platform on Kubernetes. Combine it with a GitOps controller to deploy the resulting images; see what GitOps is.
Who owns what
Buildpacks change the split of responsibilities between application teams and the platform team, and it is worth writing that split down before rollout.
| Responsibility | Application team | Platform team |
|---|---|---|
| Source code, tests and dependency manifests | Owns | Supports |
| project.toml settings for the service | Owns | Publishes allowed options |
| Choice and version of builder | Uses | Owns |
| Base image patching and rebase schedule | Tests rebased images | Owns |
| Custom buildpacks for in-house needs | Requests | Builds and maintains |
| SBOM storage, scanning and signing | Fixes findings in its dependencies | Runs the pipeline steps |
This split is the main reason platform teams adopt buildpacks. Developers stop maintaining packaging code they rarely think about, and the people who care about base images and security own them in one place.
Troubleshooting common build problems
Most early problems fall into a few groups.
- No buildpack detected. The detect phase found no group that matches the source. Check that the build path points at the directory that holds the manifest file, such as
pom.xmlorpackage.json, and that the builder includes a buildpack for your language. - Wrong runtime version. Buildpacks pick a default version when you do not ask for one. Set the version through the variable or manifest field the buildpack documents, and commit it in
project.tomlso every build uses the same one. - Slow builds in CI. Each CI job may start with an empty cache. Reuse the previous image's layers by publishing to the same registry repository, and check that your runners can pull the builder quickly.
- Missing system package. If the app needs an operating system library that the run image lacks, consider an image extension, a custom buildpack or, for a one-off service, a Dockerfile.
Run builds locally with pack first. It uses the same lifecycle as CI, so a problem you reproduce on a laptop is much faster to fix.
Adoption checklist
- Pick a builder (Paketo, or a vendor or custom builder) and pin it by version or digest.
- Build two or three representative services with
packand compare image size, start time and behaviour with the existing images. - Add
project.tomlfor any build settings, and document which buildpack variables your teams may use. - Replace
docker buildin one pipeline, then roll out to others. - Add SBOM extraction, scanning and signing after the build step.
- Schedule rebase jobs for base image updates and route the results through normal testing.
- Keep a documented path for services that still need a Dockerfile.
Hands-on practice with images, registries and pipelines is part of our Docker training, available in the Kharadi, Pune classroom and live online for learners in other cities.
Frequently asked questions
What are Cloud Native Buildpacks?
Cloud Native Buildpacks are a CNCF project that turns application source code into OCI container images without a Dockerfile. Buildpacks detect the language, install runtimes and dependencies, and the lifecycle assembles the final image.
Is Cloud Native Buildpacks a CNCF graduated project?
Yes. According to the CNCF project page, Buildpacks was accepted in October 2018, moved to Incubating in November 2020 and moved to Graduated on 17 July 2026.
What is a builder in buildpacks?
A builder is an OCI image that bundles an ordered set of buildpacks, a build-time base image, the lifecycle binary and a reference to the run image the final application uses.
How does pack rebase work?
pack rebase updates an app image's layer metadata to reference a newer version of its run base image. It does not rebuild the application, so operating system patches can be applied to many images quickly.
Which Paketo builder should I use now?
Paketo's October 2025 restructuring lists paketobuildpacks/ubuntu-noble-builder as the replacement for builder-jammy-base, and paketobuildpacks/builder-noble-java-tiny for Java tiny images. Check Paketo's site for newer builders before you pin one.
Can buildpacks generate an SBOM?
Yes. pack sbom download writes the SBOM files of an image to a layers/sbom directory in CycloneDX, SPDX or Syft format, and the --remote flag reads them from a registry image.
When should I keep using a Dockerfile?
Keep a Dockerfile for applications that need unusual system packages, languages without a maintained buildpack, or very minimal images such as a static binary on a scratch base.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0