Skip to content

Faster container startup: default to start mode, publish multi-arch image#8

Merged
matthewhorridge merged 2 commits into
mainfrom
feature/faster-startup-multiarch
Apr 18, 2026
Merged

Faster container startup: default to start mode, publish multi-arch image#8
matthewhorridge merged 2 commits into
mainfrom
feature/faster-startup-multiarch

Conversation

@matthewhorridge

Copy link
Copy Markdown
Contributor

Summary

Addresses #7 — the two contributors to the ~70s cold start.

  • Default to start instead of start-dev. kc.sh build already runs at image build time, so production mode launches without the per-boot augmentation that dev mode performs. Local cold-start timing on Apple Silicon dropped from ~70s to ~17s (Quarkus startup ~5.4s). KC_HTTP_ENABLED=true and KC_HOSTNAME_STRICT=false are baked in as runtime defaults so start works out of the box behind a TLS-terminating reverse proxy. start-dev is still available as an explicit override.
  • Multi-arch image. The release workflow now uses docker/setup-qemu-action + docker/setup-buildx-action + docker/build-push-action@v6 to publish a manifest covering both linux/amd64 and linux/arm64. Arm64 consumers stop running under Rosetta. The old single-arch exec-maven-plugin docker build/push block in pom.xml has been removed.
  • The release workflow builds amd64 first with load: true so test-entrypoint.sh still runs against a locally-loaded image; the multi-arch push: true build follows (buildx reuses the amd64 layers).

Test plan

  • docker build -t protegeproject/webprotege-keycloak:test . succeeds against the updated Dockerfile
  • ./test-entrypoint.sh — all 15 assertions pass (first-boot realm import, protocol mapper fix, URI patching, restart idempotency) against the start-mode image
  • Cold-start timing sanity check: ~17s from docker run to "Realm configuration complete" on arm64 (previously ~70s)
  • Release workflow run succeeds end-to-end and publishes a multi-arch manifest
  • docker manifest inspect protegeproject/webprotege-keycloak:<version> shows both linux/amd64 and linux/arm64 after the next release

🤖 Generated with Claude Code

Drop the exec-maven-plugin that drove a single-arch `docker build`/`docker
push` and switch the release workflow to `docker/build-push-action@v6`
with QEMU + buildx, producing a manifest that covers both linux/amd64 and
linux/arm64.  Arm64 consumers (Apple Silicon in particular) get a native
image instead of running under Rosetta, which speeds up JVM startup.

The workflow builds amd64 first with `load: true` so the entrypoint
integration test runs against a local image, then does the multi-arch
push.  Buildx cache reuses the amd64 layers across the two builds.

Refs #7.
`kc.sh build` already runs at image build time, so `start` can launch
without the per-boot augmentation that `start-dev` performs.  In local
testing on Apple Silicon this cut cold-start time from ~70s to ~17s.

Set `KC_HTTP_ENABLED=true` and `KC_HOSTNAME_STRICT=false` as runtime
defaults in the Dockerfile so `start` launches cleanly behind a TLS-
terminating reverse proxy without any extra configuration.  Both can be
overridden at `docker run` time.

`start-dev` remains available as an explicit command override for
contributors iterating on theme or realm config.

Refs #7.
@matthewhorridge matthewhorridge merged commit adda54b into main Apr 18, 2026
2 checks passed
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