perf(docker): avoid emulated Java builds#740
Conversation
- pin the Maven and Node build stage to BUILDPLATFORM - cache the package installation layer before source changes - exclude unrelated modules and generated artifacts from context - preserve reactor POMs and Hubble release license files
There was a problem hiding this comment.
Pull request overview
This pull request optimizes the HugeGraph Hubble Docker image build so that architecture-independent build artifacts are produced once on the native BuildKit build platform and then reused, reducing time spent building under QEMU for multi-platform images.
Changes:
- Force the Docker build stage to run on
$BUILDPLATFORMto avoid emulated (QEMU) Maven/Node builds during multi-arch builds. - Reorder Dockerfile steps so OS package installation can be cached independently of source changes.
- Add a root
.dockerignoreto shrink the Docker build context while still retaining Maven reactor POMs and required release-doc inputs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hugegraph-hubble/Dockerfile | Builds artifacts on the native BuildKit platform and improves layer cache reuse by moving COPY after package install. |
| .dockerignore | Reduces Docker build context size while preserving needed Maven reactor/module metadata and release-doc inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- build the Java distribution once on BUILDPLATFORM - collapse duplicate Maven packaging into one reactor build - cache target-platform package installation independently - document multi-platform build and native library boundaries
VGalaxies
left a comment
There was a problem hiding this comment.
✅ Review summary
Note
The Docker platform pinning, pruned root context, and Loader reactor build are consistent with the Hubble and Loader packaging requirements.
🧪 How this was verified
| Independent check | What it traced | Outcome |
|---|---|---|
| 🏗️ Multi-platform runtime semantics | Followed the BUILDPLATFORM builder stages, target-platform final stages, cross-stage copies, and Java/frontend/native resources in both Dockerfiles. |
The reviewer found no target-architecture runtime defect. |
| 📦 Root context and packaging | Traced .dockerignore negations, Docker COPY inputs, Maven reactor modules, Hubble/Loader assembly inputs, and the updated README commands. |
The reviewer confirmed that pruning the root context does not remove a required build or packaging input. |
| 🚀 Real amd64/arm64 builds | Inspected the Hubble and Loader validation runs against the PR head and new root build context. | Both multi-platform builds completed successfully; the native-resource audit also confirmed arm64 support in the packaged LZ4, Snappy, Commons Crypto, and shaded gRPC artifacts. |
Note
check-dependency-license is currently failing on an unchanged dependency inventory; the review found no link between that failure and this Docker-only diff.
🤖 Codex review · GPT-5.6 Sol · effort: max
Summary
Measured validation
Read-only validation runs:
Companion workflow/cache changes: hugegraph/actions#22.
Verification