Speed up multi-arch Docker build by batching LDAP cert import in api/Dockerfile - #181
Merged
Merged
Conversation
…tion Co-authored-by: dk1844 <4457378+dk1844@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize certificate import process in Docker build
Speed up multi-arch Docker build by batching LDAP cert import in api/Dockerfile
Sep 3, 2026
dk1844
marked this pull request as ready for review
September 3, 2026 08:48
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.
Overview
Multi-platform image builds (
linux/amd64,linux/arm64) were extremely slow on ARM64 runners because the cert-import step inapi/Dockerfilelaunched onekeytoolJVM process per PEM file. Under QEMU emulation each JVM launch cost ~130s, so ~7 certs meant ~910s just for this step.Changes:
/etc/pki/ca-trust/source/anchors/and runupdate-ca-trust extract(native, no JVM) — this also regenerates a consolidated Java truststore containing the system CAs plus the LDAP CAs, with aliases derived deterministically from each certificate instead of$RANDOM.$JAVA_HOME/lib/security/cacertswith a singlekeytool -importkeystorecall, replacing the per-file loop and cutting N emulated JVM launches down to exactly 1.base,base-ssl-true,base-ssl-false,final), all build args, and the self-signed cert generation logic are unchanged.Closes #180
Release Notes
linux/amd64cert import (one keytool JVM launch instead of one per certificate)Related