From a3551d477dfc1c1c72d1a84966ae7e6d95575639 Mon Sep 17 00:00:00 2001 From: maskpp Date: Wed, 25 Sep 2024 12:28:45 +0800 Subject: [PATCH] try cross-compile taiko-client --- .github/workflows/taiko-client--docker.yml | 2 +- packages/taiko-client/Dockerfile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/taiko-client--docker.yml b/.github/workflows/taiko-client--docker.yml index ece6656bcc..4dc8933a81 100644 --- a/.github/workflows/taiko-client--docker.yml +++ b/.github/workflows/taiko-client--docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GAR" on: push: - branches: [main] + branches: [taiko_client_docker_] tags: - "taiko-client-v*" paths: diff --git a/packages/taiko-client/Dockerfile b/packages/taiko-client/Dockerfile index dea1333dce..7261386aeb 100644 --- a/packages/taiko-client/Dockerfile +++ b/packages/taiko-client/Dockerfile @@ -1,8 +1,8 @@ -FROM --platform=$BUILDPLATFORM golang:1.21 AS builder +FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS builder ARG TARGETOS ARG TARGETARCH -RUN apt-get update && apt-get install -y git make g++-x86-64-linux-gnu libc6-dev-amd64-cross +RUN apk update && apk add --no-cache --update gcc musl-dev linux-headers git make build-base WORKDIR /build @@ -13,9 +13,9 @@ COPY packages/taiko-client/ packages/taiko-client/ WORKDIR /build/packages/taiko-client RUN echo "TARGETOS=${TARGETOS}, TARGETARCH=${TARGETARCH}" && \ if [ "$TARGETARCH" = "amd64" ]; then \ - CGO_ENABLED=1 CC=x86_64-linux-gnu-gcc GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build; \ + GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build; \ else \ - make build; \ + GOOS=linux GOARCH=amd64 make build; \ fi FROM alpine:latest