distribution/dockerfiles/git.Dockerfile
Austin Vazquez 21c718d58c
Add Go 1.22 support to CI
This change adds Go 1.22 to the Go version matrix in CI and updates all
Dockerfiles to use Go 1.21.8.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-03-27 15:59:13 +00:00

23 lines
848 B
Docker

# syntax=docker/dockerfile:1
ARG GO_VERSION=1.21.8
ARG ALPINE_VERSION=3.19
FROM alpine:${ALPINE_VERSION} AS base
RUN apk add --no-cache git gpg
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS gitvalidation
ARG GIT_VALIDATION_VERSION=v1.1.0
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod \
GOBIN=/out go install "github.com/vbatts/git-validation@${GIT_VALIDATION_VERSION}"
FROM base AS validate
ARG COMMIT_RANGE
RUN if [ -z "$COMMIT_RANGE" ]; then echo "COMMIT_RANGE required" && exit 1; fi
ENV GIT_CHECK_EXCLUDE="./vendor"
WORKDIR /src
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/root/.cache \
--mount=from=gitvalidation,source=/out/git-validation,target=/usr/bin/git-validation \
git-validation -q -range "${COMMIT_RANGE}" -run short-subject,dangling-whitespace