Skip to content

fix: register SAP Root CA via update-ca-certificates for BuildKit - #639

Merged
liuwei08 merged 1 commit into
masterfrom
fix/DM01-6122
Aug 27, 2026
Merged

fix: register SAP Root CA via update-ca-certificates for BuildKit#639
liuwei08 merged 1 commit into
masterfrom
fix/DM01-6122

Conversation

@liuwei08

Copy link
Copy Markdown
Contributor

Problem

Follow-up to DM01-5956. The previous fix appended saprootca.pem directly to /etc/ssl/certs/ca-certificates.crt, but x509 errors persisted in production on gardener-eu-de-1 when BuildKit imported --cache-from manifests.

Root Cause

Docker 23's embedded BuildKit is a Go binary. Go's crypto/tls does not re-read ca-certificates.crt from disk at runtime — it uses the CA pool that the Alpine ca-certificates package builds via update-ca-certificates. That tool:

  1. Reads entries from /usr/local/share/ca-certificates/
  2. Rebuilds /etc/ssl/certs/ca-certificates.crt
  3. Creates symlinks in /etc/ssl/certs/

A raw cat >> ca-certificates.crt bypasses this mechanism, so the new bytes are present in the file but the symlink index that Go's TLS stack relies on is never updated.

Fix

Replace the raw append with the proper Alpine mechanism:

cp /etc/ssl/certs/saprootca.pem /usr/local/share/ca-certificates/saprootca.crt
update-ca-certificates

This runs before dockerd starts, so the CA pool is fully rebuilt before BuildKit makes any TLS connections.

Verification

Tested locally in docker:23.0-dind:

  • update-ca-certificates increases ca-certificates.crt size correctly
  • Creates ca-cert-saprootca.pem symlink in /etc/ssl/certs/

Reproduction job at InfraBox-examples/dm01-6122 confirmed x509 errors with the old approach. Full verification against production requires a new job image build and deployment.

Change

src/job/entrypoint.sh — 5 lines changed

@liuwei08 liuwei08 changed the title fix(DM01-6122): register SAP Root CA via update-ca-certificates for BuildKit fix: register SAP Root CA via update-ca-certificates for BuildKit Aug 27, 2026
…uildKit

The DM01-5956 fix appended saprootca.pem directly to ca-certificates.crt,
but this does not work for Docker 23's embedded BuildKit. BuildKit's Go TLS
client uses the system CA bundle rebuilt by update-ca-certificates, which
reads from /usr/local/share/ca-certificates/ — not from raw appends to the
bundle file.

Fix: copy the CA into /usr/local/share/ca-certificates/ and call
update-ca-certificates before dockerd starts. This properly rebuilds
ca-certificates.crt and creates the expected symlink in /etc/ssl/certs/,
which Go's crypto/tls picks up when verifying InfraBox registry TLS certs
during BuildKit --cache-from manifest imports.

Verified locally: update-ca-certificates increases ca-certificates.crt size
and creates ca-cert-saprootca.pem symlink in /etc/ssl/certs/.
@liuwei08
liuwei08 merged commit ffb04c1 into master Aug 27, 2026
2 checks passed
@liuwei08
liuwei08 deleted the fix/DM01-6122 branch August 27, 2026 07:56
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.

1 participant