You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2026/07/12 09:52:00 UTC

(hugegraph-computer) branch cx-vermeer-docker-perf created (now f5bd393a)

This is an automated email from the ASF dual-hosted git repository.

imbajin pushed a change to branch cx-vermeer-docker-perf
in repository https://gitbox.apache.org/repos/asf/hugegraph-computer.git


      at f5bd393a refactor(vermeer): cross-compile Docker binaries

This branch includes the following new commits:

     new f5bd393a refactor(vermeer): cross-compile Docker binaries

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(hugegraph-computer) 01/01: refactor(vermeer): cross-compile Docker binaries

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

imbajin pushed a commit to branch cx-vermeer-docker-perf
in repository https://gitbox.apache.org/repos/asf/hugegraph-computer.git

commit f5bd393a4d6b8b511876148090680e9b09dbaa92
Author: imbajin <ji...@apache.org>
AuthorDate: Sun Jul 12 17:46:10 2026 +0800

    refactor(vermeer): cross-compile Docker binaries
    
    - pin the Go builder to the native build platform
    - cross-compile binaries for each requested target platform
    - cache Go modules and compiler artifacts across builds
    - isolate UI dependency downloads from source changes
---
 vermeer/Dockerfile | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/vermeer/Dockerfile b/vermeer/Dockerfile
index 44da2502..638fde97 100644
--- a/vermeer/Dockerfile
+++ b/vermeer/Dockerfile
@@ -14,14 +14,27 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-FROM golang:1.23-alpine AS builder
+FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder
+ARG TARGETOS
+ARG TARGETARCH
 RUN apk add --no-cache npm bash curl
-COPY ./ /src/
 WORKDIR /src/
 ENV CGO_ENABLED="0"
+
+COPY go.mod go.sum ./
+RUN --mount=type=cache,target=/go/pkg/mod go mod download
+
+COPY scripts/download_ui_assets.sh ./scripts/
+COPY ui/package.json ./ui/
 RUN ./scripts/download_ui_assets.sh
-RUN cd asset && go generate
-RUN go build -o /go/bin/app
+
+COPY ./ ./
+RUN --mount=type=cache,target=/go/pkg/mod \
+    --mount=type=cache,target=/root/.cache/go-build \
+    cd asset && go generate
+RUN --mount=type=cache,target=/go/pkg/mod \
+    --mount=type=cache,target=/root/.cache/go-build \
+    GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /go/bin/app
 
 FROM alpine
 EXPOSE 8080