Files
zeekayandHanzo Dev f2ae99a68f docker: golang 1.26.5, the version go.mod already requires
The base image could not satisfy this module's own go directive, so the
build died at `go mod download`:

    go: go.mod requires go >= X (running Y; GOTOOLCHAIN=local)

GOTOOLCHAIN=local is correct for a hermetic build -- it refuses to silently
fetch a different toolchain -- which turns the gap into a hard error rather
than a slow surprise.

Latent until now: every docker build on this forge failed earlier, first at
`Extract metadata` (git-runner af8b7ce + d0a9bc7) and then at the gha cache
exporter (hanzoai/.github e4492d9). With those cleared the build reaches the
Dockerfile for the first time and 17 repos turn out to share this mismatch.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-01 04:19:16 -07:00

20 lines
592 B
Docker

# Multi-arch image. Built in CI (Cloud Build) — never locally. Cloud Build
# runners build native amd64 and arm64 in parallel; QEMU is banned.
#
# Image: ghcr.io/hanzoai/template:<tag>
FROM golang:1.26.5-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -trimpath -ldflags="-s -w" \
-o /out/appd ./cmd/appd
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/appd /usr/local/bin/appd
USER nonroot:nonroot
EXPOSE 8080 9100
ENTRYPOINT ["/usr/local/bin/appd"]