Copilot commented on code in PR #2981: URL: https://github.com/apache/hugegraph/pull/2981#discussion_r3006116128
########## hugegraph-store/Dockerfile: ########## @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1.7 + Review Comment: The BuildKit-specific features introduced here (the `# syntax=...` directive and `RUN --mount=type=cache`) require Docker BuildKit to be enabled. If some environments still use the legacy builder (or run in restricted networks), this can fail because the frontend image may need to be pulled. Consider either documenting the BuildKit requirement in the Dockerfile comments and/or switching to a less specific frontend tag like `docker/dockerfile:1` unless a `1.7`-only feature is required. ########## hugegraph-store/Dockerfile: ########## @@ -19,11 +21,68 @@ # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ +COPY pom.xml ./ +COPY hugegraph-cluster-test/pom.xml ./hugegraph-cluster-test/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml +COPY hugegraph-commons/pom.xml ./hugegraph-commons/pom.xml +COPY hugegraph-commons/hugegraph-common/pom.xml ./hugegraph-commons/hugegraph-common/pom.xml +COPY hugegraph-commons/hugegraph-rpc/pom.xml ./hugegraph-commons/hugegraph-rpc/pom.xml +COPY hugegraph-pd/pom.xml ./hugegraph-pd/pom.xml +COPY hugegraph-pd/hg-pd-cli/pom.xml ./hugegraph-pd/hg-pd-cli/pom.xml +COPY hugegraph-pd/hg-pd-client/pom.xml ./hugegraph-pd/hg-pd-client/pom.xml +COPY hugegraph-pd/hg-pd-common/pom.xml ./hugegraph-pd/hg-pd-common/pom.xml +COPY hugegraph-pd/hg-pd-core/pom.xml ./hugegraph-pd/hg-pd-core/pom.xml +COPY hugegraph-pd/hg-pd-dist/pom.xml ./hugegraph-pd/hg-pd-dist/pom.xml +COPY hugegraph-pd/hg-pd-grpc/pom.xml ./hugegraph-pd/hg-pd-grpc/pom.xml +COPY hugegraph-pd/hg-pd-service/pom.xml ./hugegraph-pd/hg-pd-service/pom.xml +COPY hugegraph-pd/hg-pd-test/pom.xml ./hugegraph-pd/hg-pd-test/pom.xml +COPY hugegraph-server/pom.xml ./hugegraph-server/pom.xml +COPY hugegraph-server/hugegraph-api/pom.xml ./hugegraph-server/hugegraph-api/pom.xml +COPY hugegraph-server/hugegraph-cassandra/pom.xml ./hugegraph-server/hugegraph-cassandra/pom.xml +COPY hugegraph-server/hugegraph-core/pom.xml ./hugegraph-server/hugegraph-core/pom.xml Review Comment: This explicit, duplicated list of `COPY ... pom.xml` entries is likely to become brittle: adding/removing Maven modules will require updating this list (and the equivalent lists in other Dockerfiles), otherwise the `mvn dependency:go-offline` step can fail due to missing module directories/poms. Consider using BuildKit-supported patterns like `COPY --parents **/pom.xml ./` (optionally alongside root-level build files) to reduce duplication while keeping the cache-friendly layer structure. ```suggestion COPY --parents **/pom.xml ./ ``` ########## hugegraph-pd/Dockerfile: ########## @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1.7 + Review Comment: The BuildKit-specific features introduced here (the `# syntax=...` directive and `RUN --mount=type=cache`) require Docker BuildKit to be enabled. If some environments still use the legacy builder (or run in restricted networks), this can fail because the frontend image may need to be pulled. Consider either documenting the BuildKit requirement in the Dockerfile comments and/or switching to a less specific frontend tag like `docker/dockerfile:1` unless a `1.7`-only feature is required. ########## hugegraph-pd/Dockerfile: ########## @@ -19,11 +21,68 @@ # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ +COPY pom.xml ./ +COPY hugegraph-cluster-test/pom.xml ./hugegraph-cluster-test/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml +COPY hugegraph-commons/pom.xml ./hugegraph-commons/pom.xml +COPY hugegraph-commons/hugegraph-common/pom.xml ./hugegraph-commons/hugegraph-common/pom.xml +COPY hugegraph-commons/hugegraph-rpc/pom.xml ./hugegraph-commons/hugegraph-rpc/pom.xml +COPY hugegraph-pd/pom.xml ./hugegraph-pd/pom.xml +COPY hugegraph-pd/hg-pd-cli/pom.xml ./hugegraph-pd/hg-pd-cli/pom.xml +COPY hugegraph-pd/hg-pd-client/pom.xml ./hugegraph-pd/hg-pd-client/pom.xml +COPY hugegraph-pd/hg-pd-common/pom.xml ./hugegraph-pd/hg-pd-common/pom.xml +COPY hugegraph-pd/hg-pd-core/pom.xml ./hugegraph-pd/hg-pd-core/pom.xml +COPY hugegraph-pd/hg-pd-dist/pom.xml ./hugegraph-pd/hg-pd-dist/pom.xml +COPY hugegraph-pd/hg-pd-grpc/pom.xml ./hugegraph-pd/hg-pd-grpc/pom.xml +COPY hugegraph-pd/hg-pd-service/pom.xml ./hugegraph-pd/hg-pd-service/pom.xml +COPY hugegraph-pd/hg-pd-test/pom.xml ./hugegraph-pd/hg-pd-test/pom.xml +COPY hugegraph-server/pom.xml ./hugegraph-server/pom.xml +COPY hugegraph-server/hugegraph-api/pom.xml ./hugegraph-server/hugegraph-api/pom.xml +COPY hugegraph-server/hugegraph-cassandra/pom.xml ./hugegraph-server/hugegraph-cassandra/pom.xml +COPY hugegraph-server/hugegraph-core/pom.xml ./hugegraph-server/hugegraph-core/pom.xml Review Comment: This explicit, duplicated list of `COPY ... pom.xml` entries is likely to become brittle: adding/removing Maven modules will require updating this list (and the equivalent lists in other Dockerfiles), otherwise the `mvn dependency:go-offline` step can fail due to missing module directories/poms. Consider using BuildKit-supported patterns like `COPY --parents **/pom.xml ./` (optionally alongside root-level build files) to reduce duplication while keeping the cache-friendly layer structure. ```suggestion COPY --parents **/pom.xml ./ ``` ########## hugegraph-server/Dockerfile: ########## @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1.7 Review Comment: The BuildKit-specific features introduced here (the `# syntax=...` directive and `RUN --mount=type=cache`) require Docker BuildKit to be enabled. If some environments still use the legacy builder (or run in restricted networks), this can fail because the frontend image may need to be pulled. Consider either documenting the BuildKit requirement in the Dockerfile comments and/or switching to a less specific frontend tag like `docker/dockerfile:1` unless a `1.7`-only feature is required. ```suggestion # syntax=docker/dockerfile:1 # NOTE: This Dockerfile requires Docker BuildKit to be enabled (DOCKER_BUILDKIT=1). ``` ########## hugegraph-server/Dockerfile: ########## @@ -19,11 +21,68 @@ # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -Dmaven.test.skip=true -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ +COPY pom.xml ./ +COPY hugegraph-cluster-test/pom.xml ./hugegraph-cluster-test/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml +COPY hugegraph-commons/pom.xml ./hugegraph-commons/pom.xml +COPY hugegraph-commons/hugegraph-common/pom.xml ./hugegraph-commons/hugegraph-common/pom.xml +COPY hugegraph-commons/hugegraph-rpc/pom.xml ./hugegraph-commons/hugegraph-rpc/pom.xml +COPY hugegraph-pd/pom.xml ./hugegraph-pd/pom.xml +COPY hugegraph-pd/hg-pd-cli/pom.xml ./hugegraph-pd/hg-pd-cli/pom.xml +COPY hugegraph-pd/hg-pd-client/pom.xml ./hugegraph-pd/hg-pd-client/pom.xml +COPY hugegraph-pd/hg-pd-common/pom.xml ./hugegraph-pd/hg-pd-common/pom.xml +COPY hugegraph-pd/hg-pd-core/pom.xml ./hugegraph-pd/hg-pd-core/pom.xml +COPY hugegraph-pd/hg-pd-dist/pom.xml ./hugegraph-pd/hg-pd-dist/pom.xml +COPY hugegraph-pd/hg-pd-grpc/pom.xml ./hugegraph-pd/hg-pd-grpc/pom.xml +COPY hugegraph-pd/hg-pd-service/pom.xml ./hugegraph-pd/hg-pd-service/pom.xml +COPY hugegraph-pd/hg-pd-test/pom.xml ./hugegraph-pd/hg-pd-test/pom.xml +COPY hugegraph-server/pom.xml ./hugegraph-server/pom.xml +COPY hugegraph-server/hugegraph-api/pom.xml ./hugegraph-server/hugegraph-api/pom.xml +COPY hugegraph-server/hugegraph-cassandra/pom.xml ./hugegraph-server/hugegraph-cassandra/pom.xml +COPY hugegraph-server/hugegraph-core/pom.xml ./hugegraph-server/hugegraph-core/pom.xml Review Comment: This explicit, duplicated list of `COPY ... pom.xml` entries is likely to become brittle: adding/removing Maven modules will require updating this list (and the equivalent lists in other Dockerfiles), otherwise the `mvn dependency:go-offline` step can fail due to missing module directories/poms. Consider using BuildKit-supported patterns like `COPY --parents **/pom.xml ./` (optionally alongside root-level build files) to reduce duplication while keeping the cache-friendly layer structure. ```suggestion COPY --parents pom.xml **/pom.xml ./ ``` ########## hugegraph-server/Dockerfile-hstore: ########## @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1.7 + Review Comment: The BuildKit-specific features introduced here (the `# syntax=...` directive and `RUN --mount=type=cache`) require Docker BuildKit to be enabled. If some environments still use the legacy builder (or run in restricted networks), this can fail because the frontend image may need to be pulled. Consider either documenting the BuildKit requirement in the Dockerfile comments and/or switching to a less specific frontend tag like `docker/dockerfile:1` unless a `1.7`-only feature is required. ########## hugegraph-server/Dockerfile-hstore: ########## @@ -19,11 +21,68 @@ # 1st stage: build source code FROM maven:3.9.0-eclipse-temurin-11 AS build -COPY . /pkg WORKDIR /pkg ARG MAVEN_ARGS -RUN mvn package $MAVEN_ARGS -e -B -ntp -DskipTests -Dmaven.javadoc.skip=true && pwd && ls -l && rm \ +COPY pom.xml ./ +COPY hugegraph-cluster-test/pom.xml ./hugegraph-cluster-test/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-dist/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-minicluster/pom.xml +COPY hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml ./hugegraph-cluster-test/hugegraph-clustertest-test/pom.xml +COPY hugegraph-commons/pom.xml ./hugegraph-commons/pom.xml +COPY hugegraph-commons/hugegraph-common/pom.xml ./hugegraph-commons/hugegraph-common/pom.xml +COPY hugegraph-commons/hugegraph-rpc/pom.xml ./hugegraph-commons/hugegraph-rpc/pom.xml +COPY hugegraph-pd/pom.xml ./hugegraph-pd/pom.xml +COPY hugegraph-pd/hg-pd-cli/pom.xml ./hugegraph-pd/hg-pd-cli/pom.xml +COPY hugegraph-pd/hg-pd-client/pom.xml ./hugegraph-pd/hg-pd-client/pom.xml +COPY hugegraph-pd/hg-pd-common/pom.xml ./hugegraph-pd/hg-pd-common/pom.xml +COPY hugegraph-pd/hg-pd-core/pom.xml ./hugegraph-pd/hg-pd-core/pom.xml +COPY hugegraph-pd/hg-pd-dist/pom.xml ./hugegraph-pd/hg-pd-dist/pom.xml +COPY hugegraph-pd/hg-pd-grpc/pom.xml ./hugegraph-pd/hg-pd-grpc/pom.xml +COPY hugegraph-pd/hg-pd-service/pom.xml ./hugegraph-pd/hg-pd-service/pom.xml +COPY hugegraph-pd/hg-pd-test/pom.xml ./hugegraph-pd/hg-pd-test/pom.xml +COPY hugegraph-server/pom.xml ./hugegraph-server/pom.xml +COPY hugegraph-server/hugegraph-api/pom.xml ./hugegraph-server/hugegraph-api/pom.xml +COPY hugegraph-server/hugegraph-cassandra/pom.xml ./hugegraph-server/hugegraph-cassandra/pom.xml +COPY hugegraph-server/hugegraph-core/pom.xml ./hugegraph-server/hugegraph-core/pom.xml Review Comment: This explicit, duplicated list of `COPY ... pom.xml` entries is likely to become brittle: adding/removing Maven modules will require updating this list (and the equivalent lists in other Dockerfiles), otherwise the `mvn dependency:go-offline` step can fail due to missing module directories/poms. Consider using BuildKit-supported patterns like `COPY --parents **/pom.xml ./` (optionally alongside root-level build files) to reduce duplication while keeping the cache-friendly layer structure. ```suggestion COPY --parents **/pom.xml ./ ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
