diff --git a/hack/dockerfiles/generated-files.Dockerfile b/hack/dockerfiles/generated-files.Dockerfile index 3ec5c7be1352b..30f4955b9ba1e 100644 --- a/hack/dockerfiles/generated-files.Dockerfile +++ b/hack/dockerfiles/generated-files.Dockerfile @@ -2,24 +2,24 @@ # protoc is dynamically linked to glibc to can't use golang:1.10-alpine FROM golang:1.13-buster AS gobuild-base -ARG PROTOC_VERSION=3.1.0 -ARG GOGO_VERSION=master + RUN apt-get update && apt-get --no-install-recommends install -y \ git \ unzip \ && true + +ARG PROTOC_VERSION=3.1.0 RUN wget -q https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local -RUN go get -d github.com/gogo/protobuf/protoc-gen-gogofaster \ - && cd /go/src/github.com/gogo/protobuf \ - && git checkout -q $GOGO_VERSION \ - && go install ./protoc-gen-gogo ./protoc-gen-gogofaster ./protoc-gen-gogoslick +ARG GOGO_VERSION=v1.3.2 +RUN --mount=target=/root/.cache,type=cache GO111MODULE=on go install \ + github.com/gogo/protobuf/protoc-gen-gogo@${GOGO_VERSION} \ + github.com/gogo/protobuf/protoc-gen-gogofaster@${GOGO_VERSION} \ + github.com/gogo/protobuf/protoc-gen-gogoslick@${GOGO_VERSION} ARG PROTOBUF_VERSION=v1.3.3 -RUN go get -d github.com/golang/protobuf/protoc-gen-go \ - && cd /go/src/github.com/golang/protobuf \ - && git checkout -q $PROTOBUF_VERSION \ - && go install ./protoc-gen-go +RUN --mount=target=/root/.cache,type=cache GO111MODULE=on go install \ + github.com/golang/protobuf/protoc-gen-go@${PROTOBUF_VERSION} WORKDIR /go/src/github.com/moby/buildkit