# syntax=docker/dockerfile:1.3-labs ARG GO_VERSION=1.17.0 FROM golang:${GO_VERSION}-alpine AS vendored RUN apk add --no-cache git rsync WORKDIR /src RUN --mount=target=/context \ --mount=target=.,type=tmpfs \ --mount=target=/go/pkg/mod,type=cache <&2 'ERROR: Vendor result differs. Please vendor your package with "make vendor"' git status --porcelain -- go.mod go.sum vendor exit 1 fi EOT