Skip to content

Commit

Permalink
generated files: use "go install" to install binaries
Browse files Browse the repository at this point in the history
Now that this repository moved to go1.16, we can use 'go install' to install
these binaries.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Aug 13, 2021
1 parent 533a202 commit bd4b02d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions hack/dockerfiles/generated-files.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@

# protoc is dynamically linked to glibc to can't use golang:1.10-alpine
FROM golang:1.16-buster AS gobuild-base
# https://github.com/golang/protobuf/blob/v1.3.5/.travis.yml#L15
ARG PROTOC_VERSION=3.11.4
ARG GOGO_VERSION=v1.3.2

RUN apt-get update && apt-get --no-install-recommends install -y \
unzip \
&& true

# https://github.com/golang/protobuf/blob/v1.3.5/.travis.yml#L15
ARG PROTOC_VERSION=3.11.4
ARG TARGETOS TARGETARCH
RUN set -e; \
arch=$(echo $TARGETARCH | sed -e s/amd64/x86_64/ -e s/arm64/aarch_64/); \
wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${TARGETOS}-${arch}.zip && unzip protoc-${PROTOC_VERSION}-${TARGETOS}-${arch}.zip -d /usr/local

RUN git clone https://github.com/gogo/protobuf.git /go/src/github.com/gogo/protobuf \
&& 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.5
RUN git clone https://github.com/golang/protobuf.git /go/src/github.com/golang/protobuf \
&& 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

Expand Down

0 comments on commit bd4b02d

Please sign in to comment.