Files
agent/deployments/docker/Dockerfile.demo-go-agent
zeekayandClaude Opus 5 3cb580cc07 Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; the intPtr test helper had no callers left once new(expr) could
say it. omitzero is not applied, since it changes what the JSON says.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-16 19:25:34 -07:00

23 lines
931 B
Docker

FROM --platform=$BUILDPLATFORM golang:1.27.1-alpine AS builder
RUN apk add --no-cache ca-certificates tzdata
RUN addgroup -g 65532 -S nonroot && adduser -u 65532 -S nonroot -G nonroot
WORKDIR /workspace
COPY sdk/go ./sdk/go
COPY examples/go_agent_nodes ./examples/go_agent_nodes
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod \
cd examples/go_agent_nodes && go mod download && \
CGO_ENABLED=0 go build -o /out/hanzo-agents-demo-go-agent ./main.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY --from=builder /out/hanzo-agents-demo-go-agent /usr/local/bin/hanzo-agents-demo-go-agent
EXPOSE 8001
USER 65532:65532
ENTRYPOINT ["/usr/local/bin/hanzo-agents-demo-go-agent"]