# syntax=docker/dockerfile:1 ARG GO_VERSION=1.23 ARG FORMATS=md,yaml FROM golang:${GO_VERSION}-alpine AS docsgen WORKDIR /src RUN --mount=target=. \ --mount=target=/root/.cache,type=cache \ go build -mod=vendor -o /out/docsgen ./docs/generate.go FROM alpine AS gen RUN apk add --no-cache rsync git WORKDIR /src COPY --from=docsgen /out/docsgen /usr/bin ARG FORMATS ARG BUILDX_EXPERIMENTAL RUN --mount=target=/context \ --mount=target=.,type=tmpfs <&2 'ERROR: Docs result differs. Please update with "make docs"' git status --porcelain -- docs/reference exit 1 fi EOT