Skip to content

fix: let the image build trust a proxy CA for apk upgrade - #146

Merged
oto-macenauer-absa merged 1 commit into
masterfrom
fix/trusted-ca-certs
Nov 6, 2026
Merged

oto-macenauer-absa merged 1 commit into
masterfrom
fix/trusted-ca-certs

Conversation

@oto-macenauer-absa

Copy link
Copy Markdown
Collaborator

Problem

Since #140 the image build runs apk upgrade, which fetches from https://dl-cdn.alpinelinux.org. Behind a TLS-intercepting corporate proxy it fails with TLS: 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 + COPY into /opt/certs/; every *.pem/*.crt there is appended to /etc/ssl/certs/ca-certificates.crt before apk upgrade.
  • trusted_certs/ is committed empty (.gitkeep; everything else gitignored), so a plain docker build is unchanged.
  • build-image.yml takes an optional ca-certificates secret (PEM) and writes it to trusted_certs/ before building.
  • contract/DEPLOYMENT.md documents it under Private networks.

Notes: the certificate file stays at /opt/certs/ in the image. The ca-certificates package upgrade regenerates the system bundle, so the shipped bundle is the stock one.

Verification (local)

  • apk trusts exactly the OpenSSL default bundle: with a single unrelated CA it fails with the same server certificate not trusted.
  • Build with empty trusted_certs/: succeeds.
  • Build with a cert dropped in (no trailing newline): appended, upgrade succeeds.
  • private-registry.spec.js, nginx-config.spec.js pass.
  • Not yet tested behind the real corporate proxy.

🤖 Generated with Claude Code

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>
@oto-macenauer-absa
oto-macenauer-absa merged commit ffbbb3e into master Nov 6, 2026
8 checks passed
@oto-macenauer-absa
oto-macenauer-absa deleted the fix/trusted-ca-certs branch November 6, 2026 14:39
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