mirror of
https://github.com/hanzoai/search-fts5.git
synced 2026-10-30 20:22:47 +00:00
`go mod download` failed with go: go.mod requires go >= 1.26.4 (running go 1.23.12; GOTOOLCHAIN=local) GOTOOLCHAIN=local in the golang image means it will not fetch a newer toolchain, so the base image must satisfy the directive on its own.
24 lines
1.0 KiB
Docker
24 lines
1.0 KiB
Docker
# Pure-Go build (modernc.org/sqlite — no CGO, FTS5 compiled in). Multi-arch via
|
|
# the platform args the builder injects; arcd builds linux/amd64 for hanzo-k8s.
|
|
# golang:1.26 — go.mod declares `go 1.26.4`. On 1.23 the build died with
|
|
# go: go.mod requires go >= 1.26.4 (running go 1.23.12; GOTOOLCHAIN=local)
|
|
# GOTOOLCHAIN=local in the image means it will not self-upgrade, so the base
|
|
# image has to satisfy the directive itself.
|
|
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS build
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
|
|
go build -trimpath -ldflags='-s -w' -o /out/search-fts5 ./cmd/search-fts5
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/search-fts5 /usr/local/bin/search-fts5
|
|
# Data dir is a mounted PVC in k8s; default matches the CR.
|
|
ENV FTS5_DB_PATH=/data/search.db FTS5_ADDR=:7700
|
|
EXPOSE 7700
|
|
USER nonroot:nonroot
|
|
ENTRYPOINT ["/usr/local/bin/search-fts5"]
|