From 16e267fa63988b128e48a2f5c59fe5f35cc823ed Mon Sep 17 00:00:00 2001 From: Rory N Date: Fri, 3 May 2024 19:32:27 +0100 Subject: [PATCH] ci: multi-platform image --- .github/workflows/build-image.yaml | 1 + Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 57afd55..2a0f78f 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -27,5 +27,6 @@ jobs: uses: docker/build-push-action@v5 with: push: false + platforms: linux/amd64,linux/arm64,linux/arm/v6 context: . tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4847db5..b60deb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM golang:1.22 as builder +FROM golang:1.22-alpine as builder WORKDIR /app COPY . . RUN go mod download -RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o bin/starling_exporter cmd/starling_exporter.go +RUN go build -o bin/starling_exporter cmd/starling_exporter.go FROM scratch