mirror of
https://github.com/hanzoai/service-template.git
synced 2026-10-30 18:22:53 +00:00
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]>
20 lines
592 B
Docker
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"]
|