Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,19 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.11.1
with:
use: true
platforms: linux/arm64,linux/amd64

- name: build and push
uses: docker/build-push-action@v6
with:
push: true
build-args: |
VERSION=${{ env.RELEASE_VERSION }}
platforms: linux/arm64,linux/amd64
tags: |
ghcr.io/vladopajic/go-test-coverage:${{ env.RELEASE_VERSION }}
ghcr.io/vladopajic/go-test-coverage:${{ steps.majorver.outputs.major-tag }}
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# GO_VERSION: automatically update to most recent via dependabot
FROM golang:1.25.3 AS builder
FROM --platform=$BUILDPLATFORM golang:1.25.3 AS builder

WORKDIR /workspace

COPY go.mod go.mod
Expand All @@ -10,10 +11,13 @@ RUN go mod download all
COPY ./ ./

ARG VERSION
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
ARG TARGETOS
ARG TARGETARCH

RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -o go-test-coverage .

FROM gcr.io/distroless/base:latest
FROM --platform=$BUILDPLATFORM gcr.io/distroless/base:latest
WORKDIR /
COPY --from=builder /workspace/go-test-coverage .
COPY --from=builder /usr/local/go/bin/go /usr/local/go/bin/go
Expand Down
Loading