# syntax=docker/dockerfile:1 ARG GO_VERSION=1.25 ARG ALPINE_VERSION=3.22 FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golatest FROM golatest AS docsgen WORKDIR /src ENV CGO_ENABLED=0 RUN --mount=target=. \ --mount=target=/root/.cache,type=cache \ --mount=target=/go/pkg/mod,type=cache \ go build -mod=vendor -o /out/docsgen ./frontend/dockerfile/linter/generate.go FROM alpine AS gen RUN apk add --no-cache rsync git WORKDIR /src COPY --from=docsgen /out/docsgen /usr/bin RUN --mount=target=/context \ --mount=target=.,type=tmpfs <&2 'ERROR: Dockerfile docs result differs. Please update with "make docs-dockerfile"' git status --porcelain -- frontend/dockerfile/docs/rules/ exit 1 fi EOT