File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,17 @@ jobs:
1919 username : ${{ github.repository_owner }}
2020 password : ${{ secrets.GITHUB_TOKEN }}
2121
22+ - name : Set up Docker Buildx
23+ 24+ with :
25+ use : true
26+ platforms : linux/arm64,linux/amd64
27+
2228 - name : build and push
2329 uses : docker/build-push-action@v6
2430 with :
2531 push : true
32+ platforms : linux/arm64,linux/amd64
2633 build-args : |
2734 VERSION=dev
2835 tags : |
3946 name : test
4047 runs-on : ubuntu-latest
4148 needs : build-dev-image
49+ strategy :
50+ matrix :
51+ os : [ ubuntu-latest, ubuntu-24.04-arm ]
4252
4353 steps :
4454 - name : checkout
Original file line number Diff line number Diff line change @@ -40,12 +40,19 @@ jobs:
4040 username : ${{ github.repository_owner }}
4141 password : ${{ secrets.GITHUB_TOKEN }}
4242
43+ - name : Set up Docker Buildx
44+ 45+ with :
46+ use : true
47+ platforms : linux/arm64,linux/amd64
48+
4349 - name : build and push
4450 uses : docker/build-push-action@v6
4551 with :
4652 push : true
4753 build-args : |
4854 VERSION=${{ env.RELEASE_VERSION }}
55+ platforms : linux/arm64,linux/amd64
4956 tags : |
5057 ghcr.io/vladopajic/go-test-coverage:${{ env.RELEASE_VERSION }}
5158 ghcr.io/vladopajic/go-test-coverage:${{ steps.majorver.outputs.major-tag }}
Original file line number Diff line number Diff line change 11# GO_VERSION: automatically update to most recent via dependabot
2- FROM golang:1.25.3 AS builder
2+ FROM --platform=$BUILDPLATFORM golang:1.25.3 AS builder
3+
34WORKDIR /workspace
45
56COPY go.mod go.mod
@@ -10,10 +11,13 @@ RUN go mod download all
1011COPY ./ ./
1112
1213ARG VERSION
13- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
14+ ARG TARGETOS
15+ ARG TARGETARCH
16+
17+ RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
1418 go build -o go-test-coverage .
1519
16- FROM gcr.io/distroless/base:latest
20+ FROM --platform=$BUILDPLATFORM gcr.io/distroless/base:latest
1721WORKDIR /
1822COPY --from=builder /workspace/go-test-coverage .
1923COPY --from=builder /usr/local/go/bin/go /usr/local/go/bin/go
You can’t perform that action at this time.
0 commit comments