Skip to content

Commit

Permalink
added arm64 build support
Browse files Browse the repository at this point in the history
Signed-off-by: jasmingacic <jasmin.gacic@gmail.com>
  • Loading branch information
jasmingacic committed Aug 18, 2022
1 parent f617dc5 commit adb4e46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
context: server
file: server/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
Expand All @@ -73,7 +74,8 @@ jobs:
ref: "main"
fetch-depth: 0
token: ${{ secrets.CI_BOT_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Install Helm
uses: azure/setup-helm@v1
with:
Expand Down
8 changes: 5 additions & 3 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17 AS build
FROM --platform=$BUILDPLATFORM docker.io/golang:1.17 as builder
WORKDIR /go/src
# Copy `go.mod` for definitions and `go.sum` to invalidate the next layer
# in case of a change in the dependencies
Expand All @@ -7,11 +7,13 @@ COPY go.mod go.sum ./
RUN go mod download

ARG TELEMETRY_TOKEN
ARG TARGETARCH
ARG TARGETOS

COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -v -ldflags "-X github.com/kubeshop/kusk-gateway/pkg/analytics.TelemetryToken=$TELEMETRY_TOKEN" -o kusk-gateway-api
RUN RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -v -ldflags "-X github.com/kubeshop/kusk-gateway/pkg/analytics.TelemetryToken=$TELEMETRY_TOKEN" -o kusk-gateway-api

FROM scratch AS runtime
FROM --platform=$BUILDPLATFORM gcr.io/distroless/static:nonroot
COPY --from=build --chown=65532:65532 /go/src/kusk-gateway-api ./
EXPOSE 8080/tcp

Expand Down

0 comments on commit adb4e46

Please sign in to comment.