diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 37ed3e25e..5341e2ad7 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -42,6 +42,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + provenance: false push-op-batcher: runs-on: ubuntu-latest @@ -75,6 +77,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + provenance: false push-op-proposer: runs-on: ubuntu-latest @@ -108,6 +112,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + provenance: false push-op-bootnode: runs-on: ubuntu-latest @@ -141,3 +147,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + provenance: false diff --git a/op-batcher/Makefile b/op-batcher/Makefile index 24d719c3b..12d0d7135 100644 --- a/op-batcher/Makefile +++ b/op-batcher/Makefile @@ -25,7 +25,13 @@ ifeq ($(shell uname),Darwin) endif op-batcher: +ifeq ($(TARGETARCH),arm64) + wget https://musl.cc/aarch64-linux-musl-cross.tgz + tar zxf aarch64-linux-musl-cross.tgz + export PATH=$$PATH:/app/op-batcher/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-batcher ./cmd +else env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-batcher ./cmd +endif clean: rm bin/op-batcher diff --git a/op-bootnode/Makefile b/op-bootnode/Makefile index f9f276e9e..bdc52769e 100644 --- a/op-bootnode/Makefile +++ b/op-bootnode/Makefile @@ -8,7 +8,13 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION) LDFLAGS := -ldflags "$(LDFLAGSSTRING)" op-bootnode: +ifeq ($(TARGETARCH),arm64) + wget https://musl.cc/aarch64-linux-musl-cross.tgz + tar zxf aarch64-linux-musl-cross.tgz + export PATH=$$PATH:/app/op-bootnode/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-bootnode ./cmd +else env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-bootnode ./cmd +endif clean: rm -f bin/op-bootnode diff --git a/op-node/Dockerfile b/op-node/Dockerfile index 5207e2bcf..a0c24f543 100644 --- a/op-node/Dockerfile +++ b/op-node/Dockerfile @@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.21.5-alpine3.18 as builder ARG VERSION=v0.0.0 -RUN apk add --no-cache build-base libc-dev +RUN apk add --no-cache build-base libc-dev wget RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash # build op-node with the shared go.mod & go.sum files @@ -17,10 +17,10 @@ COPY ./go.sum /app/go.sum COPY ./.git /app/.git WORKDIR /app/op-node - RUN go mod download -ARG TARGETOS TARGETARCH +ARG TARGETOS +ARG TARGETARCH ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__" ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__" diff --git a/op-node/Makefile b/op-node/Makefile index 4c4cb9b3e..8138d3d51 100644 --- a/op-node/Makefile +++ b/op-node/Makefile @@ -26,7 +26,13 @@ ifeq ($(shell uname),Darwin) endif op-node: +ifeq ($(TARGETARCH),arm64) + wget https://musl.cc/aarch64-linux-musl-cross.tgz + tar zxf aarch64-linux-musl-cross.tgz + export PATH=$$PATH:/app/op-node/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-node ./cmd/main.go +else env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-node ./cmd/main.go +endif clean: rm bin/op-node diff --git a/op-proposer/Makefile b/op-proposer/Makefile index dff47b41d..911ad381b 100644 --- a/op-proposer/Makefile +++ b/op-proposer/Makefile @@ -20,7 +20,13 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION) LDFLAGS := -ldflags "$(LDFLAGSSTRING)" op-proposer: +ifeq ($(TARGETARCH),arm64) + wget https://musl.cc/aarch64-linux-musl-cross.tgz + tar zxf aarch64-linux-musl-cross.tgz + export PATH=$$PATH:/app/op-proposer/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-proposer ./cmd +else env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-proposer ./cmd +endif clean: rm bin/op-proposer