Repository navigation
fix: let the image build trust a proxy CA for apk upgrade - #146
Merged
Merged
Conversation
Behind a TLS-intercepting proxy `apk upgrade` fails with "TLS: server certificate not trusted" (exit 99): the base image trusts public CAs only. Same pattern as AbsaOSS/EventGate: every *.pem/*.crt in trusted_certs/ (or the directory TRUSTED_SSL_CERTS names) is appended to the system CA bundle before apk runs. The committed directory is empty, so a plain build is unchanged. build-image.yml takes the PEM as an optional `ca-certificates` secret and writes it there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Since #140 the image build runs
apk upgrade, which fetches fromhttps://dl-cdn.alpinelinux.org. Behind a TLS-intercepting corporate proxy it fails withTLS: server certificate not trusted(exit 99): the proxy re-signs with a corporate CA the base image does not trust.Fix
Same pattern as AbsaOSS/EventGate's Dockerfile:
ARG TRUSTED_SSL_CERTS=./trusted_certs+COPYinto/opt/certs/; every*.pem/*.crtthere is appended to/etc/ssl/certs/ca-certificates.crtbeforeapk upgrade.trusted_certs/is committed empty (.gitkeep; everything else gitignored), so a plaindocker buildis unchanged.build-image.ymltakes an optionalca-certificatessecret (PEM) and writes it totrusted_certs/before building.contract/DEPLOYMENT.mddocuments it under Private networks.Notes: the certificate file stays at
/opt/certs/in the image. Theca-certificatespackage upgrade regenerates the system bundle, so the shipped bundle is the stock one.Verification (local)
server certificate not trusted.trusted_certs/: succeeds.private-registry.spec.js,nginx-config.spec.jspass.🤖 Generated with Claude Code