mirror of
https://github.com/docker/buildx.git
synced 2024-11-22 15:37:16 +08:00
4f2cc0e220
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
19 lines
479 B
Docker
19 lines
479 B
Docker
# syntax = docker/dockerfile:1.0-experimental
|
|
FROM golang:1.12-alpine AS vendored
|
|
RUN apk add --no-cache git
|
|
WORKDIR /src
|
|
RUN --mount=target=/src,rw \
|
|
--mount=target=/go/pkg/mod,type=cache \
|
|
go mod tidy && go mod vendor && \
|
|
mkdir /out && cp -r go.mod go.sum vendor /out
|
|
|
|
FROM scratch AS update
|
|
COPY --from=vendored /out /out
|
|
|
|
FROM vendored AS validate
|
|
RUN --mount=target=.,rw \
|
|
git add -A && \
|
|
rm -rf vendor && \
|
|
cp -rf /out/* . && \
|
|
./hack/validate-vendor check
|