Merge pull request #9 from tonistiigi/vendor-dockerfile

hack: update vendor dockerfile
This commit is contained in:
Tibor Vass 2019-03-25 14:35:23 -07:00 committed by GitHub
commit 3f4b9e1fcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1,9 +1,11 @@
# syntax = docker/dockerfile:1.0-experimental
FROM golang:1.12-alpine AS vendored
RUN apk add --no-cache git
RUN apk add --no-cache git rsync
WORKDIR /src
RUN --mount=target=/src,rw \
RUN --mount=target=/context \
--mount=target=.,type=tmpfs,readwrite \
--mount=target=/go/pkg/mod,type=cache \
rsync -a /context/. . && \
go mod tidy && go mod vendor && \
mkdir /out && cp -r go.mod go.sum vendor /out
@ -11,7 +13,9 @@ FROM scratch AS update
COPY --from=vendored /out /out
FROM vendored AS validate
RUN --mount=target=.,rw \
RUN --mount=target=/context \
--mount=target=.,type=tmpfs,readwrite \
rsync -a /context/. . && \
git add -A && \
rm -rf vendor && \
cp -rf /out/* . && \