From ddf321236dbc7d9e16ebe32a0ef2f7bc2b6aab3d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 13 Aug 2021 16:15:42 +0200 Subject: [PATCH] [0.8] generated files: use "go install" to install binaries Now that this repository moved to go1.16, we can use 'go install' to install these binaries. based on commit bd4b02d5a88bc55e01fa6a7863746a4ac9e591c4 Signed-off-by: Sebastiaan van Stijn --- hack/dockerfiles/generated-files.Dockerfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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