mirror of
https://github.com/hanzoai/insights-go.git
synced 2026-10-30 14:54:07 +00:00
The SDK-compliance workflow hands sdk_compliance_adapter/Dockerfile to the PostHog test harness on every PR and push to main, and that Dockerfile still pulled golang:1.21-alpine against a go.mod requiring 1.26.4. GOTOOLCHAIN=local in the official golang images makes that a hard failure rather than a toolchain download. Pin to 1.26.5 and set GOTOOLCHAIN=auto so a future go.mod bump resolves itself instead of breaking the compliance run. Co-authored-by: Hanzo Dev <[email protected]>
33 lines
734 B
Docker
33 lines
734 B
Docker
FROM golang:1.26.5-alpine AS builder
|
|
|
|
# The official golang images set GOTOOLCHAIN=local, so a base older than the
|
|
# `go` directive in go.mod fails the build outright rather than fetching a
|
|
# toolchain. `auto` lets a future go.mod bump resolve itself against the
|
|
# checksum database instead of hard-failing here.
|
|
ENV GOTOOLCHAIN=auto
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy the SDK source
|
|
COPY go.mod go.sum ./
|
|
COPY *.go ./
|
|
|
|
# Copy adapter
|
|
COPY sdk_compliance_adapter/main.go /app/adapter/
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Build adapter
|
|
RUN cd /app/adapter && go build -o /app/adapter-server main.go
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/adapter-server /app/adapter-server
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["/app/adapter-server"]
|