mirror of
https://github.com/luxfi/zapdb.git
synced 2026-10-30 15:12:20 +00:00
Currency bump: golang builder images -> 1.26.5 (latest stable). Adds ENV GOTOOLCHAIN=auto to each Go builder stage. The official golang images set GOTOOLCHAIN=local, so a builder image older than the module's go directive is a hard mid-build failure. The pin stays the hermetic fast path; auto is the safety net for the next go.mod bump. No go.mod go directive was changed. Builder images move; directives stay. Co-authored-by: Hanzo Dev <[email protected]>
28 lines
890 B
Docker
28 lines
890 B
Docker
# Build context must be the repo root (luxfi/zapdb).
|
|
# docker build -t zapdb-replicate -f deploy/replicate/Dockerfile .
|
|
FROM golang:1.26.5-bookworm AS build
|
|
ENV GOTOOLCHAIN=auto
|
|
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
go mod download
|
|
|
|
COPY . .
|
|
ARG VERSION=dev
|
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
|
go build \
|
|
-trimpath \
|
|
-ldflags "-s -w -X main.version=${VERSION}" \
|
|
-o /out/zapdb-replicate \
|
|
./cmd/replicate
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/zapdb-replicate /usr/local/bin/zapdb-replicate
|
|
USER nonroot:nonroot
|
|
ENTRYPOINT ["/usr/local/bin/zapdb-replicate"]
|
|
CMD ["replicate", "--config", "/etc/zapdb-replicate/config.yaml"]
|