Files
docker-cli/dockerfiles/Dockerfile.authors
Sebastiaan van Stijn 1b0d6fc804 Dockerfile: add ALPINE_VERSION build-arg
This allows us to pin to a specific version of Alpine, in case the
golang:alpine image switches to a newer version, which may at times
be incompatible, e.g. see https://github.com/moby/moby/issues/44570

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-04 14:57:43 +01:00

26 lines
563 B
Docker

# syntax=docker/dockerfile:1
ARG ALPINE_VERSION=3.16
FROM alpine:${ALPINE_VERSION} AS gen
RUN apk add --no-cache bash git
WORKDIR /src
RUN --mount=type=bind,target=. \
mkdir /out && ./scripts/docs/generate-authors.sh /out
FROM scratch AS update
COPY --from=gen /out /
FROM gen AS validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /out/* .
diff=$(git status --porcelain -- AUTHORS)
if [ -n "$diff" ]; then
echo >&2 'ERROR: Authors result differs. Please update with "make -f docker.Makefile authors"'
echo "$diff"
exit 1
fi
EOT