Skip to content

Commit

Permalink
Merge pull request #2146 from thaJeztah/fix_protobuf_install
Browse files Browse the repository at this point in the history
generated files: update google/protobuf v1.3.5, protoc v3.14.0 and fix install for go modules
  • Loading branch information
tonistiigi committed Jun 1, 2021
2 parents 8df5671 + acbe79f commit 12cfc87
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions hack/dockerfiles/generated-files.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

# 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
# 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 \
git \
unzip \
&& true
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 \
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 PROTOBUF_VERSION=v1.3.3
RUN go get -d github.com/golang/protobuf/protoc-gen-go \
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
Expand Down
2 changes: 2 additions & 0 deletions hack/update-generated-files
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
set -eu

gogo_version=$(awk '$1 == "github.com/gogo/protobuf" { print $2 }' go.mod)
protobuf_version=$(awk '$3 == "github.com/golang/protobuf" { print $4 }' go.mod)
output=$(mktemp -d -t buildctl-output.XXXXXXXXXX)

buildxCmd build \
--target "update" \
--build-arg "GOGO_VERSION=$gogo_version" \
--build-arg "PROTOBUF_VERSION=$protobuf_version" \
--output "type=local,dest=$output" \
--file "./hack/dockerfiles/generated-files.Dockerfile" \
.
Expand Down
4 changes: 3 additions & 1 deletion util/stack/stack.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 12cfc87

Please sign in to comment.