Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
context: .
file: Dockerfile
push: false
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

zizmor:
uses: drumandbytes/reusable-actions/.github/workflows/zizmor.yml@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
artifact-metadata: write # storage record for the pushed image
uses: drumandbytes/reusable-actions/.github/workflows/docker-publish.yml@v1
with:
# The cluster runs amd64 only.
platforms: linux/amd64
# Go cross-compiles on the native runner (Dockerfile uses $BUILDPLATFORM), so no QEMU.
platforms: linux/amd64,linux/arm64
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM golang:1.26-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
RUN apk add --no-cache ca-certificates

WORKDIR /build

COPY go.mod go.sum ./
RUN go mod download
RUN --mount=type=cache,target=/go/pkg/mod go mod download

COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o paddock-api .
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -ldflags="-s -w" -o paddock-api .
RUN mkdir /data

# scratch has no CA bundle or zoneinfo: CAs copied below, tzdata embedded (main.go).
Expand Down
Loading