mirror of https://github.com/docker/compose.git
Use go modules on build
This commit is contained in:
parent
24c035e822
commit
6feedaf939
12
Dockerfile
12
Dockerfile
|
@ -4,15 +4,20 @@ ARG GO_VERSION=1.14.2
|
||||||
FROM golang:${GO_VERSION} AS fs
|
FROM golang:${GO_VERSION} AS fs
|
||||||
ARG TARGET_OS=unknown
|
ARG TARGET_OS=unknown
|
||||||
ARG TARGET_ARCH=unknown
|
ARG TARGET_ARCH=unknown
|
||||||
ARG PWD=$GOPATH/src/github.com/docker/api
|
ARG PWD=/api
|
||||||
|
ENV GO111MODULE=on
|
||||||
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
make \
|
make \
|
||||||
git \
|
git \
|
||||||
protobuf-compiler \
|
protobuf-compiler \
|
||||||
libprotobuf-dev
|
libprotobuf-dev
|
||||||
|
|
||||||
RUN go get github.com/golang/protobuf/protoc-gen-go && \
|
RUN go get github.com/golang/protobuf/protoc-gen-go && \
|
||||||
go get golang.org/x/tools/cmd/goimports && \
|
go get golang.org/x/tools/cmd/goimports && \
|
||||||
go get gotest.tools/gotestsum
|
go get gotest.tools/gotestsum && \
|
||||||
|
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.26.0
|
||||||
|
|
||||||
WORKDIR ${PWD}
|
WORKDIR ${PWD}
|
||||||
ADD go.* ${PWD}
|
ADD go.* ${PWD}
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
@ -42,3 +47,6 @@ COPY --from=make-cross /go/src/github.com/docker/api/bin/* .
|
||||||
|
|
||||||
FROM make-protos as test
|
FROM make-protos as test
|
||||||
RUN make -f builder.Makefile test
|
RUN make -f builder.Makefile test
|
||||||
|
|
||||||
|
FROM fs AS lint
|
||||||
|
RUN make -f builder.Makefile lint
|
||||||
|
|
Loading…
Reference in New Issue