Skip to content

fix: include CA certificates in the pack base image#2609

Open
officialasishkumar wants to merge 1 commit into
buildpacks:mainfrom
officialasishkumar:fix/base-image-ca-certificates
Open

fix: include CA certificates in the pack base image#2609
officialasishkumar wants to merge 1 commit into
buildpacks:mainfrom
officialasishkumar:fix/base-image-ca-certificates

Conversation

@officialasishkumar

Copy link
Copy Markdown

Summary

The delivery / docker workflow builds the Dockerfile twice:

  • the tiny image (buildpacksio/pack and :latest) from gcr.io/distroless/static
  • the base image (buildpacksio/pack:<version>-base and :base) from ubuntu:jammy

The distroless base bundles a CA certificate store, but the ubuntu:jammy image does not ship the ca-certificates package. As a result the -base image has no trusted roots, and any pack command that reaches a registry over TLS fails (reported in #2488):

ERROR: fetching builder image: connect to repo store "...": Get "https://index.docker.io/v2/": tls: failed to verify certificate: x509: certificate signed by unknown authority

The fix copies the CA bundle from the golang builder stage (which is Debian based and includes ca-certificates) into the final image. This restores trusted roots for the ubuntu:jammy based -base image and is a no-op for the distroless image, which already ships the same bundle at that path, so a single line covers every published base image.

Output

I verified this by building the Dockerfile with each base image and performing an HTTPS request to a registry from inside each resulting container.

Before

$ docker run --rm buildpacksio/pack:base builder inspect bellsoft/buildpacks.builder:musl
REMOTE:
ERROR: fetching builder image: ... tls: failed to verify certificate: x509: certificate signed by unknown authority

After

$ docker run --rm <pack:base built from this PR> builder inspect bellsoft/buildpacks.builder:musl
# TLS handshake succeeds and the remote image is inspected

The distroless :latest image is unaffected and keeps working.

Documentation

  • Should this change be documented?
    • Yes, see #___
    • No

Related

Resolves #2488

@officialasishkumar officialasishkumar requested review from a team as code owners May 20, 2026 07:44
@github-actions github-actions Bot added this to the 0.41.0 milestone May 20, 2026
The delivery-docker workflow builds the Dockerfile twice: the tiny image
(buildpacksio/pack and :latest) from gcr.io/distroless/static, and the
base image (buildpacksio/pack:<version>-base and :base) from ubuntu:jammy.

The distroless base bundles a CA certificate store, but the ubuntu:jammy
image does not ship the ca-certificates package. As a result the -base
image has no trusted roots, and any pack command that talks to a registry
over TLS fails:

    ERROR: ... Get "https://index.docker.io/v2/": tls: failed to verify
    certificate: x509: certificate signed by unknown authority

Copy the CA bundle from the golang builder stage (which is Debian based
and includes ca-certificates) into the final image. This restores trusted
roots for the ubuntu:jammy -base image and is a harmless no-op for the
distroless image, which already ships the same bundle at that path, so a
single line fixes every published base image.

Verified by building the Dockerfile with both base images and performing
an HTTPS request to a registry from inside each: ubuntu:jammy fails
without the copy and succeeds with it, and the distroless image keeps
working.

Resolves buildpacks#2488

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
@officialasishkumar officialasishkumar force-pushed the fix/base-image-ca-certificates branch from 4b9dcb1 to 4fc4456 Compare May 20, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing CA Certificates in OCI image

1 participant