File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 4242 uses : docker/build-push-action@v5
4343 with :
4444 context : .
45- platforms : linux/amd64,linux/arm64
45+ platforms : linux/amd64
4646 push : ${{ github.event_name != 'pull_request' }}
4747 tags : ${{ steps.meta.outputs.tags }}
4848 labels : ${{ steps.meta.outputs.labels }}
7676 username : ${{ secrets.DOCKER_USERNAME }}
7777 password : ${{ secrets.DOCKER_PASSWORD }}
7878
79+ - name : Edit arm64 arch for Dockerfile
80+ run : |
81+ sed -i 's/ubuntu:22.04/arm64v8\/ubuntu:20.04/g' Dockerfile
82+ echo "ENV KCL_FAST_EVAL=1" >> Dockerfile
83+
7984 - name : Extract metadata (tags, labels) for Docker
8085 id : meta
8186 uses : docker/metadata-action@v5
8590 uses : docker/build-push-action@v5
8691 with :
8792 context : .
88- platforms : linux/amd64,linux/ arm64
93+ platforms : linux/arm64
8994 push : ${{ github.event_name != 'pull_request' }}
9095 tags : ${{ steps.meta.outputs.tags }}
9196 labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 11FROM --platform=${BUILDPLATFORM} golang:1.21 AS build
22COPY / /src
33WORKDIR /src
4- RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build make build
4+
5+ # The TARGETOS and TARGETARCH args are set by docker. We set GOOS and GOARCH to
6+ # these values to ask Go to compile a binary for these architectures. If
7+ # TARGETOS and TARGETOS are different from BUILDPLATFORM, Go will cross compile
8+ # for us (e.g. compile a linux/amd64 binary on a linux/arm64 build machine).
9+ ARG TARGETOS
10+ ARG TARGETARCH
11+
12+ RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
513
614FROM --platform=${BUILDPLATFORM} ubuntu:22.04 AS base
715ENV LANG=en_US.utf8
You can’t perform that action at this time.
0 commit comments