Skip to content
Merged
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
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Static CGO-free binary; distroless/static brings CA certs and nothing else.
FROM golang:1.27-trixie AS builder
# Cross-compile on the runner's own arch; building arm64 under QEMU took minutes.
FROM --platform=$BUILDPLATFORM golang:1.27-trixie AS builder
ARG TARGETOS TARGETARCH
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /github-actions-runner-exporter .
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -ldflags="-s -w" -o /github-actions-runner-exporter .

FROM gcr.io/distroless/static-debian13:nonroot
COPY --from=builder /github-actions-runner-exporter /github-actions-runner-exporter
Expand Down
Loading