fix: register SAP Root CA via update-ca-certificates for BuildKit - #639
Merged
Conversation
…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
force-pushed
the
fix/DM01-6122
branch
from
August 27, 2026 07:05
cab4bd0 to
1608ed3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to DM01-5956. The previous fix appended
saprootca.pemdirectly to/etc/ssl/certs/ca-certificates.crt, but x509 errors persisted in production ongardener-eu-de-1when BuildKit imported--cache-frommanifests.Root Cause
Docker 23's embedded BuildKit is a Go binary. Go's
crypto/tlsdoes not re-readca-certificates.crtfrom disk at runtime — it uses the CA pool that the Alpineca-certificatespackage builds viaupdate-ca-certificates. That tool:/usr/local/share/ca-certificates//etc/ssl/certs/ca-certificates.crt/etc/ssl/certs/A raw
cat >> ca-certificates.crtbypasses 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:
This runs before
dockerdstarts, so the CA pool is fully rebuilt before BuildKit makes any TLS connections.Verification
Tested locally in
docker:23.0-dind:update-ca-certificatesincreasesca-certificates.crtsize correctlyca-cert-saprootca.pemsymlink in/etc/ssl/certs/Reproduction job at
InfraBox-examples/dm01-6122confirmed 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