From c6e75ca2588f14eb6c24c27a54209a5daf5b0a67 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Thu, 14 May 2026 02:05:14 +0530 Subject: [PATCH 1/7] perf(docker): improve pd/store/server image build cache efficiency --- .dockerignore | 34 ++++++++++++++++++++++++++++++ hugegraph-pd/Dockerfile | 26 +++++++++++------------ hugegraph-server/Dockerfile | 26 +++++++++++------------ hugegraph-server/Dockerfile-hstore | 26 +++++++++++------------ hugegraph-store/Dockerfile | 26 +++++++++++------------ 5 files changed, 83 insertions(+), 55 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..ebf15d1f44 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,34 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# NOTE: This file intentionally stays minimal. +# Most patterns (IDE files, build artifacts, logs, OS files) are already +# covered by .gitignore. Only Docker-specific extras are listed here. + +# Git internals (never tracked by git, must be explicit here) +.git +.gitignore +.gitattributes +.github + +# Docker compose files not needed in build context +**/docker-compose*.yml +**/docker-compose*.yaml + +# Docs not needed in build context +**/*.md +docs/ diff --git a/hugegraph-pd/Dockerfile b/hugegraph-pd/Dockerfile index 3c00093925..bd4c1e0a3e 100644 --- a/hugegraph-pd/Dockerfile +++ b/hugegraph-pd/Dockerfile @@ -16,15 +16,21 @@ # # Dockerfile for HugeGraph PD +# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg + +# Copy pom files first — layer is only invalidated when pom files change, +# keeping the Maven cache mount warm across source-only changes. +COPY --parents **/pom.xml ./ ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ - ./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz +COPY . . +RUN --mount=type=cache,target=/root/.m2 \ + mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \ + && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz # 2nd stage: runtime env # Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13 @@ -38,25 +44,17 @@ ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:Max HUGEGRAPH_HOME="hugegraph-pd" \ STDOUT_MODE="true" -#COPY . /hugegraph/hugegraph-pd WORKDIR /hugegraph-pd/ -# 1. Install environment and init HugeGraph Sever -RUN set -x \ - && rm /var/lib/dpkg/info/libc-bin.* \ - && apt-get -q clean \ - && apt-get -q update \ +# 1. Install runtime dependencies +RUN apt-get -q update \ && apt-get -q install -y --no-install-recommends --no-install-suggests \ dumb-init \ procps \ curl \ lsof \ - vim \ - cron \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && service cron start \ - && pwd && cd /hugegraph-pd/ + && rm -rf /var/lib/apt/lists/* # 2. Init docker script COPY hugegraph-pd/hg-pd-dist/docker/docker-entrypoint.sh . diff --git a/hugegraph-server/Dockerfile b/hugegraph-server/Dockerfile index be316b852d..11b3218492 100644 --- a/hugegraph-server/Dockerfile +++ b/hugegraph-server/Dockerfile @@ -16,18 +16,24 @@ # # Dockerfile for HugeGraph Server +# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg + +# Copy pom files first — layer is only invalidated when pom files change, +# keeping the Maven cache mount warm across source-only changes. +COPY --parents **/pom.xml ./ ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ - ./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz +COPY . . +RUN --mount=type=cache,target=/root/.m2 \ + mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \ + && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz # 2nd stage: runtime env -# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13 +# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13 FROM eclipse-temurin:11-jre-jammy COPY --from=build /pkg/hugegraph-server/apache-hugegraph-server-*/ /hugegraph-server/ @@ -39,25 +45,17 @@ ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:Max HUGEGRAPH_HOME="hugegraph-server" \ STDOUT_MODE="true" -#COPY . /hugegraph/hugegraph-server WORKDIR /hugegraph-server/ -# 1. Install environment and init HugeGraph Sever -RUN set -x \ - && rm /var/lib/dpkg/info/libc-bin.* \ - && apt-get -q clean \ - && apt-get -q update \ +# 1. Install runtime dependencies and configure server +RUN apt-get -q update \ && apt-get -q install -y --no-install-recommends --no-install-suggests \ dumb-init \ procps \ curl \ lsof \ - vim \ - cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ - && service cron start \ - && pwd && cd /hugegraph-server/ \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties # 2. Init docker script diff --git a/hugegraph-server/Dockerfile-hstore b/hugegraph-server/Dockerfile-hstore index 2c6e4b110f..f5edf2ac0a 100644 --- a/hugegraph-server/Dockerfile-hstore +++ b/hugegraph-server/Dockerfile-hstore @@ -15,19 +15,25 @@ # limitations under the License. # -# Dockerfile for HugeGraph Server +# Dockerfile for HugeGraph Server (hstore backend) +# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg + +# Copy pom files first — layer is only invalidated when pom files change, +# keeping the Maven cache mount warm across source-only changes. +COPY --parents **/pom.xml ./ ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ - ./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz +COPY . . +RUN --mount=type=cache,target=/root/.m2 \ + mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true \ + && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz # 2nd stage: runtime env -# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13 +# Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13 FROM eclipse-temurin:11-jre-jammy COPY --from=build /pkg/hugegraph-server/apache-hugegraph-server-*/ /hugegraph-server/ @@ -41,23 +47,17 @@ LABEL maintainer="HugeGraph Docker Maintainers " ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:MaxRAMPercentage=50 -XshowSettings:vm" \ HUGEGRAPH_HOME="hugegraph-server" -#COPY . /hugegraph/hugegraph-server WORKDIR /hugegraph-server/ -# 1. Install environment and init HugeGraph Sever -RUN set -x \ - && apt-get -q update \ +# 1. Install runtime dependencies and configure server +RUN apt-get -q update \ && apt-get -q install -y --no-install-recommends --no-install-suggests \ dumb-init \ procps \ curl \ lsof \ - vim \ - cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ - && service cron start \ - && pwd && cd /hugegraph-server/ \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties # 2. Init docker script diff --git a/hugegraph-store/Dockerfile b/hugegraph-store/Dockerfile index 902043fb55..56bf20e7b7 100644 --- a/hugegraph-store/Dockerfile +++ b/hugegraph-store/Dockerfile @@ -16,15 +16,21 @@ # # Dockerfile for HugeGraph Store +# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg + +# Copy pom files first — layer is only invalidated when pom files change, +# keeping the Maven cache mount warm across source-only changes. +COPY --parents **/pom.xml ./ ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ - ./hugegraph-server/*.tar.gz && rm ./hugegraph-pd/*.tar.gz && rm ./hugegraph-store/*.tar.gz +COPY . . +RUN --mount=type=cache,target=/root/.m2 \ + mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \ + && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz # 2nd stage: runtime env # Note: ZGC (The Z Garbage Collector) is only supported on ARM-Mac with java > 13 @@ -38,25 +44,17 @@ ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:Max HUGEGRAPH_HOME="hugegraph-store" \ STDOUT_MODE="true" -#COPY . /hugegraph/hugegraph-store WORKDIR /hugegraph-store/ -# 1. Install environment and init HugeGraph Sever -RUN set -x \ - && rm /var/lib/dpkg/info/libc-bin.* \ - && apt-get -q clean \ - && apt-get -q update \ +# 1. Install runtime dependencies +RUN apt-get -q update \ && apt-get -q install -y --no-install-recommends --no-install-suggests \ dumb-init \ procps \ curl \ lsof \ - vim \ - cron \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && service cron start \ - && pwd && cd /hugegraph-store/ + && rm -rf /var/lib/apt/lists/* # 2. Init docker script COPY hugegraph-store/hg-store-dist/docker/docker-entrypoint.sh . From 4cc2e4260ce8e5bb1fc4e5613237807fcfedef19 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Thu, 14 May 2026 18:01:34 +0530 Subject: [PATCH 2/7] perf(docker): improve pd/store/server image build cache efficiency - Add .dockerignore to reduce build context noise (defer to .gitignore, add **/target/ and Docker-specific extras explicitly) - Refactor all 4 Dockerfiles: pom-first COPY layer + BuildKit .m2 cache mount - Add # syntax=docker/dockerfile:1 for compatibility with older Docker versions - Restore cron in runtime stage to preserve optional monitor support - Remove dead code: vim, service cron start, rm libc-bin hack, set -x, pwd&&cd - Update server-ci.yml ubuntu-22.04 -> ubuntu-latest (resolves existing TODO) --- .dockerignore | 1 + .github/workflows/server-ci.yml | 3 +-- hugegraph-pd/Dockerfile | 2 ++ hugegraph-server/Dockerfile | 2 ++ hugegraph-server/Dockerfile-hstore | 2 ++ hugegraph-store/Dockerfile | 2 ++ 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index ebf15d1f44..b861cb81da 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,6 +16,7 @@ # # NOTE: This file intentionally stays minimal. +**/target/ # Most patterns (IDE files, build artifacts, logs, OS files) are already # covered by .gitignore. Only Docker-specific extras are listed here. diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 266e70feb1..854ddaaa77 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -10,8 +10,7 @@ on: jobs: build-server: - # TODO: we need test & replace it to ubuntu-24.04 or ubuntu-latest - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest env: USE_STAGE: 'false' # Whether to include the stage repository. TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis diff --git a/hugegraph-pd/Dockerfile b/hugegraph-pd/Dockerfile index bd4c1e0a3e..99548d7572 100644 --- a/hugegraph-pd/Dockerfile +++ b/hugegraph-pd/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -53,6 +54,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ + cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/hugegraph-server/Dockerfile b/hugegraph-server/Dockerfile index 11b3218492..152302fe96 100644 --- a/hugegraph-server/Dockerfile +++ b/hugegraph-server/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -54,6 +55,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ + cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties diff --git a/hugegraph-server/Dockerfile-hstore b/hugegraph-server/Dockerfile-hstore index f5edf2ac0a..43d771eb5f 100644 --- a/hugegraph-server/Dockerfile-hstore +++ b/hugegraph-server/Dockerfile-hstore @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -56,6 +57,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ + cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties diff --git a/hugegraph-store/Dockerfile b/hugegraph-store/Dockerfile index 56bf20e7b7..8e4d8202cf 100644 --- a/hugegraph-store/Dockerfile +++ b/hugegraph-store/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -53,6 +54,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ + cron \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* From 2ddb0924ee5a598bbfa5a40b94f31d5d81ac9554 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Fri, 15 May 2026 17:04:34 +0530 Subject: [PATCH 3/7] ci(docker): add build smoke job for Dockerfile changes --- .github/workflows/docker-build-ci.yml | 51 +++++++++++++++++++++++++++ .github/workflows/server-ci.yml | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker-build-ci.yml diff --git a/.github/workflows/docker-build-ci.yml b/.github/workflows/docker-build-ci.yml new file mode 100644 index 0000000000..30a97a1bbe --- /dev/null +++ b/.github/workflows/docker-build-ci.yml @@ -0,0 +1,51 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: "Docker Build CI" + +on: + push: + branches: + - master + - 'release-*' + pull_request: + paths: + - '**/Dockerfile*' + - '.dockerignore' + +jobs: + docker-build: + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + dockerfile: + - hugegraph-pd/Dockerfile + - hugegraph-store/Dockerfile + - hugegraph-server/Dockerfile + - hugegraph-server/Dockerfile-hstore + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build ${{ matrix.dockerfile }} + run: | + docker buildx build -f ${{ matrix.dockerfile }} --load . diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 854ddaaa77..117f3d55f1 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -10,7 +10,7 @@ on: jobs: build-server: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: USE_STAGE: 'false' # Whether to include the stage repository. TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis From 46d577305c1aa3b1e2fcd8a7c1b74c81ba122467 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Fri, 15 May 2026 17:58:57 +0530 Subject: [PATCH 4/7] build(docker): simplify Dockerfiles and improve build context hygiene - remove ineffective pom-only COPY optimization - remove unused cron package from runtime images - keep vim for container debugging workflows - add Maven cache mounts for faster rebuilds - expand .dockerignore to exclude IDE files, archives, logs, generated artifacts, and local build outputs - simplify Docker build flow and reduce unnecessary build context size --- .dockerignore | 42 ++++++++++++++++++++++++------ hugegraph-pd/Dockerfile | 9 +++---- hugegraph-server/Dockerfile | 9 +++---- hugegraph-server/Dockerfile-hstore | 9 +++---- hugegraph-store/Dockerfile | 9 +++---- 5 files changed, 46 insertions(+), 32 deletions(-) diff --git a/.dockerignore b/.dockerignore index b861cb81da..cd494a6e05 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,21 +15,47 @@ # limitations under the License. # -# NOTE: This file intentionally stays minimal. +# IMPORTANT: .dockerignore does NOT inherit .gitignore — patterns must be restated. + +# Build output **/target/ -# Most patterns (IDE files, build artifacts, logs, OS files) are already -# covered by .gitignore. Only Docker-specific extras are listed here. -# Git internals (never tracked by git, must be explicit here) +# Pre-extracted release dirs / archives +apache-hugegraph-*/ +**/*.tar +**/*.tar.gz* +**/*.zip +**/*.war + +# IDE / OS +.idea/ +.vscode/ +**/*.iml +**/*.iws +**/.DS_Store + +# Build / runtime artifacts +**/logs/ +**/*.log +**/*.class +**/gen-java/ +**/upload-files/ +**/dist/ +**/build/ +**/node_modules/ + +# Env files +.env.local +.env.*.local + +# Git internals .git .gitignore -.gitattributes +.gitattribut .github -# Docker compose files not needed in build context +# Compose / docs not needed in build context **/docker-compose*.yml **/docker-compose*.yaml - -# Docs not needed in build context **/*.md docs/ diff --git a/hugegraph-pd/Dockerfile b/hugegraph-pd/Dockerfile index 99548d7572..7b4b328420 100644 --- a/hugegraph-pd/Dockerfile +++ b/hugegraph-pd/Dockerfile @@ -17,18 +17,15 @@ # # Dockerfile for HugeGraph PD -# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build WORKDIR /pkg -# Copy pom files first — layer is only invalidated when pom files change, -# keeping the Maven cache mount warm across source-only changes. -COPY --parents **/pom.xml ./ +COPY . . + ARG MAVEN_ARGS -COPY . . RUN --mount=type=cache,target=/root/.m2 \ mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \ && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz @@ -54,7 +51,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ - cron \ + vim \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/hugegraph-server/Dockerfile b/hugegraph-server/Dockerfile index 152302fe96..75565dcb72 100644 --- a/hugegraph-server/Dockerfile +++ b/hugegraph-server/Dockerfile @@ -17,18 +17,15 @@ # # Dockerfile for HugeGraph Server -# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build WORKDIR /pkg -# Copy pom files first — layer is only invalidated when pom files change, -# keeping the Maven cache mount warm across source-only changes. -COPY --parents **/pom.xml ./ +COPY . . + ARG MAVEN_ARGS -COPY . . RUN --mount=type=cache,target=/root/.m2 \ mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \ && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz @@ -55,7 +52,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ - cron \ + vim \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties diff --git a/hugegraph-server/Dockerfile-hstore b/hugegraph-server/Dockerfile-hstore index 43d771eb5f..cee6a91f5b 100644 --- a/hugegraph-server/Dockerfile-hstore +++ b/hugegraph-server/Dockerfile-hstore @@ -17,18 +17,15 @@ # # Dockerfile for HugeGraph Server (hstore backend) -# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build WORKDIR /pkg -# Copy pom files first — layer is only invalidated when pom files change, -# keeping the Maven cache mount warm across source-only changes. -COPY --parents **/pom.xml ./ +COPY . . + ARG MAVEN_ARGS -COPY . . RUN --mount=type=cache,target=/root/.m2 \ mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true \ && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz @@ -57,7 +54,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ - cron \ + vim \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties diff --git a/hugegraph-store/Dockerfile b/hugegraph-store/Dockerfile index 8e4d8202cf..37088cb49d 100644 --- a/hugegraph-store/Dockerfile +++ b/hugegraph-store/Dockerfile @@ -17,18 +17,15 @@ # # Dockerfile for HugeGraph Store -# NOTE: Build with DOCKER_BUILDKIT=1 to enable cache mounts and --parents COPY. # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build WORKDIR /pkg -# Copy pom files first — layer is only invalidated when pom files change, -# keeping the Maven cache mount warm across source-only changes. -COPY --parents **/pom.xml ./ +COPY . . + ARG MAVEN_ARGS -COPY . . RUN --mount=type=cache,target=/root/.m2 \ mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true \ && rm ./hugegraph-server/*.tar.gz ./hugegraph-pd/*.tar.gz ./hugegraph-store/*.tar.gz @@ -54,7 +51,7 @@ RUN apt-get -q update \ procps \ curl \ lsof \ - cron \ + vim \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* From 09527647d1ba242582a4ccb0b391e4d1f17f7ec9 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Fri, 15 May 2026 18:02:38 +0530 Subject: [PATCH 5/7] added todo # TODO: we need test & replace it to ubuntu-24.04 or ubuntu-latest- back --- .github/workflows/server-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 117f3d55f1..266e70feb1 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -10,6 +10,7 @@ on: jobs: build-server: + # TODO: we need test & replace it to ubuntu-24.04 or ubuntu-latest runs-on: ubuntu-22.04 env: USE_STAGE: 'false' # Whether to include the stage repository. From 2f879b54abc23ca2ea58b6d85e7b21751015b4ef Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Fri, 15 May 2026 18:22:26 +0530 Subject: [PATCH 6/7] ci(docker): remove blocked buildx action from smoke workflow --- .github/workflows/docker-build-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-ci.yml b/.github/workflows/docker-build-ci.yml index 30a97a1bbe..2d88b72e7a 100644 --- a/.github/workflows/docker-build-ci.yml +++ b/.github/workflows/docker-build-ci.yml @@ -43,9 +43,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build ${{ matrix.dockerfile }} run: | - docker buildx build -f ${{ matrix.dockerfile }} --load . + docker build -f ${{ matrix.dockerfile }} . From 484b981625273bc2416b4955ce351b21637b7cd6 Mon Sep 17 00:00:00 2001 From: Himanshu Verma Date: Fri, 15 May 2026 18:58:57 +0530 Subject: [PATCH 7/7] changed **/dist/ to **/target/dist/ --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index cd494a6e05..ea145d5bc8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -40,7 +40,7 @@ apache-hugegraph-*/ **/*.class **/gen-java/ **/upload-files/ -**/dist/ +**/target/dist/ **/build/ **/node_modules/