Skip to content

Commit

Permalink
Merge pull request #85 from Peefy/fix-kcl-arm64-image-release
Browse files Browse the repository at this point in the history
fix: kcl arm64 docker image release
  • Loading branch information
Peefy authored May 24, 2024
2 parents 18c9fec + adb1c65 commit b7b3daa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Edit arm64 arch for Dockerfile
run: |
sed -i 's/ubuntu:22.04/arm64v8\/ubuntu:20.04/g' Dockerfile
echo "ENV KCL_FAST_EVAL=1" >> Dockerfile
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand Down
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
FROM --platform=${BUILDPLATFORM} golang:1.21 AS build
COPY / /src
WORKDIR /src
RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build make build

# The TARGETOS and TARGETARCH args are set by docker. We set GOOS and GOARCH to
# these values to ask Go to compile a binary for these architectures. If
# TARGETOS and TARGETOS are different from BUILDPLATFORM, Go will cross compile
# for us (e.g. compile a linux/amd64 binary on a linux/arm64 build machine).
ARG TARGETOS
ARG TARGETARCH

RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build

FROM --platform=${BUILDPLATFORM} ubuntu:22.04 AS base
ENV LANG=en_US.utf8
Expand Down

0 comments on commit b7b3daa

Please sign in to comment.