Skip to content

Commit

Permalink
Update how go binaries are installed in the docker images (#323)
Browse files Browse the repository at this point in the history
* remove use of module variable

* update how go binaries how installed in the docker images

* update how protoc-gen-validate is installed
  • Loading branch information
ido-namely authored Aug 30, 2022
1 parent 2330fee commit 58a12a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
10 changes: 0 additions & 10 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@
depNameTemplate: "grpc-tools",
datasourceTemplate: "npm",
},
{
fileMatch: [
"^Dockerfile$"
],
matchStrings: [
"GO111MODULE=on go get google\.golang\.org\/grpc@(?<currentValue>.*?)\\s*\\n"
],
depNameTemplate: "google.golang.org/grpc",
datasourceTemplate: "go",
},
{
fileMatch: [
"variables.sh$"
Expand Down
32 changes: 11 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,43 +72,33 @@ RUN curl -fsSL "https://github.com/uber/prototool/releases/download/v${uber_prot
-o /usr/local/bin/prototool && \
chmod +x /usr/local/bin/prototool

# Go get go-related bins
# go install go-related bins
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${go_protoc_gen_go_grpc_version}

# install protoc-gen-grpc-gateway and protoc-gen-openapiv2
RUN set -e && \
GO111MODULE=on go get -u github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${grpc_gateway_version} && \
cd /go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@${grpc_gateway_version}/protoc-gen-grpc-gateway && \
go install .
RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@${grpc_gateway_version}
RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${grpc_gateway_version}

RUN set -e && \
GO111MODULE=on go get -u github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@${grpc_gateway_version} && \
cd /go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@${grpc_gateway_version}/protoc-gen-openapiv2 && \
go install .
RUN go install github.com/gogo/protobuf/protoc-gen-gogo@latest
RUN go install github.com/gogo/protobuf/protoc-gen-gogofast@latest

RUN go get -u github.com/gogo/protobuf/protoc-gen-gogo
RUN go get -u github.com/gogo/protobuf/protoc-gen-gogofast
RUN go install github.com/ckaznocha/protoc-gen-lint@latest

RUN go get -u github.com/ckaznocha/protoc-gen-lint
RUN go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest

RUN set -e && \
GO111MODULE=on go get github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

RUN go get -u github.com/micro/micro/v3/cmd/protoc-gen-micro
RUN go install github.com/micro/micro/v3/cmd/protoc-gen-micro@latest

RUN go install github.com/envoyproxy/protoc-gen-validate@v${go_envoyproxy_pgv_version}

# Add Ruby Sorbet types support (rbi)
RUN go get -u github.com/coinbase/protoc-gen-rbi
RUN go install github.com/coinbase/protoc-gen-rbi@latest

RUN go get github.com/gomatic/renderizer/v2/cmd/renderizer
RUN go install github.com/gomatic/renderizer/v2/cmd/renderizer@latest

# Origin protoc-gen-go should be installed last, for not been overwritten by any other binaries(see #210)
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@${go_protoc_gen_go_version}

# Need to get these too:
RUN go get -u github.com/mwitkow/go-proto-validators/@v${go_mwitkow_gpv_version}
RUN go get -u github.com/mwitkow/go-proto-validators/protoc-gen-govalidators@v${go_mwitkow_gpv_version}
RUN go install github.com/mwitkow/go-proto-validators/protoc-gen-govalidators@v${go_mwitkow_gpv_version}

# Add scala support
RUN curl -fLO "https://github.com/scalapb/ScalaPB/releases/download/v${scala_pb_version}/protoc-gen-scala-${scala_pb_version}-linux-x86_64.zip" \
Expand Down

0 comments on commit 58a12a0

Please sign in to comment.