Debian Codegraph @

cli/dockerfiles/Dockerfile.authors

raw
1 # syntax=docker/dockerfile:1
2
3 # ALPINE_VERSION sets the version of the alpine base image to use.
4 # It must be a supported tag in the docker.io/library/alpine image repository.
5 ARG ALPINE_VERSION=3.21
6
7 FROM alpine:${ALPINE_VERSION} AS gen
8 RUN apk add --no-cache bash git
9 WORKDIR /src
10 RUN --mount=type=bind,target=. \
11 mkdir /out && ./scripts/docs/generate-authors.sh /out
12
13 FROM scratch AS update
14 COPY --from=gen /out /
15
16 FROM gen AS validate
17 RUN --mount=type=bind,target=.,rw <<EOT
18 set -e
19 git add -A
20 cp -rf /out/* .
21 diff=$(git status --porcelain -- AUTHORS)
22 if [ -n "$diff" ]; then
23 echo >&2 'ERROR: Authors result differs. Update with "make -f docker.Makefile authors"'
24 echo "$diff"
25 exit 1
26 fi
27 EOT