mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
hack: base build scripts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
10
hack/dockerfiles/lint.Dockerfile
Normal file
10
hack/dockerfiles/lint.Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
# syntax=docker/dockerfile:1.0-experimental
|
||||
|
||||
FROM golang:1.12-alpine
|
||||
RUN apk add --no-cache git
|
||||
RUN go get -u gopkg.in/alecthomas/gometalinter.v1 \
|
||||
&& mv /go/bin/gometalinter.v1 /go/bin/gometalinter \
|
||||
&& gometalinter --install
|
||||
WORKDIR /go/src/github.com/moby/buildkit
|
||||
RUN --mount=target=/go/src/github.com/tonistiigi/buildx \
|
||||
gometalinter --config=gometalinter.json ./...
|
18
hack/dockerfiles/vendor.Dockerfile
Normal file
18
hack/dockerfiles/vendor.Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
# 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
|
Reference in New Issue
Block a user