Files
diun/hack/vendor.Dockerfile
dependabot[bot] 1e3d436a75 Bump github.com/containers/image/v5 from 5.9.0 to 5.10.1 (#265)
* Bump github.com/containers/image/v5 from 5.9.0 to 5.10.1

Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.9.0 to 5.10.1.
- [Release notes](https://github.com/containers/image/releases)
- [Commits](https://github.com/containers/image/compare/v5.9.0...v5.10.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Add linux-headers

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-02-05 17:55:12 +00:00

25 lines
729 B
Docker

# syntax=docker/dockerfile:1.2
ARG GO_VERSION=1.15
FROM golang:${GO_VERSION}-alpine AS base
RUN apk add --no-cache git linux-headers musl-dev
WORKDIR /src
FROM base AS vendored
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/go/pkg/mod \
go mod tidy && go mod download && \
mkdir /out && cp go.mod go.sum /out
FROM scratch AS update
COPY --from=vendored /out /
FROM vendored AS validate
RUN --mount=type=bind,target=.,rw \
git add -A && cp -rf /out/* .; \
if [ -n "$(git status --porcelain -- go.mod go.sum)" ]; then \
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake update-vendor"'; \
git status --porcelain -- go.mod go.sum; \
exit 1; \
fi