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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: ${{ env.PUSH == 'true' }}
tags: ${{ steps.v.outputs.tags }}
labels: |
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# mock-llmd: one static Go binary on distroless.

FROM golang:1.27 AS build
# Multi-arch: Go cross-compiles, so the build stage runs on the builder's own
# platform and only the runtime stage is per-target -- no emulation needed.
FROM --platform=$BUILDPLATFORM golang:1.27 AS build
ARG TARGETOS TARGETARCH

WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download

# Only the sources: a locally built ./mock-llmd binary in the checkout stays out.
COPY *.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/mock-llmd .
RUN CGO_ENABLED=0 GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" go build -trimpath -ldflags="-s -w" -o /out/mock-llmd .

FROM gcr.io/distroless/static-debian12:nonroot

Expand Down
Loading