imbajin opened a new issue, #2977:
URL: https://github.com/apache/hugegraph/issues/2977
## Background
The Docker images for `hugegraph-pd`, `hugegraph-store`, and
`hugegraph-server` currently build with this pattern:
1. `COPY . /pkg`
2. `RUN mvn package ...`
3. Copy build outputs into runtime image
This causes low cache efficiency:
- Any repository file change (even non-Java files) can invalidate the `COPY`
layer.
- The expensive `mvn package` step is re-run too often.
- CI time stays high even when Java code is unchanged.
## Goal
Improve Docker build cache hit rate and reduce unnecessary Maven rebuild
time, **without changing image runtime behavior**.
## Scope (Starter Task / Phase A)
Please focus on the low-risk, high-impact subset:
- Improve `.dockerignore` to exclude files that should not affect image
build cache (for example: `.git/`, IDE files, temp files).
- Refactor Dockerfile layer order so dependency-related files are copied
before source files where practical.
- Use BuildKit Maven cache mount (`--mount=type=cache,target=/root/.m2`) in
Maven build steps.
- Keep existing image entrypoints/ports/runtime behavior unchanged.
## Out of Scope (Do NOT include in this issue)
- Full artifact pipeline split ("build once, package many images").
- Cross-repo CI architecture redesign.
- New release logic or tag strategy changes.
## Deliverables
- A PR with Dockerfile and/or `.dockerignore` updates.
- A short before/after note from CI showing cache behavior and build time
delta.
## Acceptance Criteria
- A second build with no Java source changes shows clear improvement in
build time and/or cache hits.
- Existing image smoke/integration checks still pass.
- No functional regression in generated images.
## Suggested Starting Points
- `hugegraph-pd/Dockerfile`
- `hugegraph-store/Dockerfile`
- `hugegraph-server/Dockerfile`
- `hugegraph-server/Dockerfile-hstore`
If the scope starts growing, keep this issue focused on Phase A and open
follow-up issues for larger refactors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]