Skip to content
Closed
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
8 changes: 4 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ concurrency:

jobs:
docker:
runs-on: cluster-runner
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -59,9 +61,7 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
platforms: |
linux/amd64
linux/arm64/v8
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# syntax=docker/dockerfile:1

FROM golang:1.24.3-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.24.3-alpine AS builder

ARG TARGETOS
ARG TARGETARCH

WORKDIR /build

ADD . /build/

RUN mkdir /out

RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod/ go build -o /out/service ./cmd
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod/ \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -o /out/service ./cmd

FROM alpine
FROM --platform=$TARGETPLATFORM alpine

RUN apk add --no-cache ca-certificates

Expand Down
Loading