# syntax=docker/dockerfile:1 ARG GO_VERSION=1.17 FROM golang:${GO_VERSION}-alpine AS base RUN apk add --no-cache git rsync WORKDIR /src FROM base AS vendored 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