Skip to content

Commit 3ad2c52

Browse files
authored
use google.golang.org/protobuf instead of github.com/golang/protobuf (#28)
use go install Upgrade golang to 1.17.3 Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 0ee7786 commit 3ad2c52

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ARG ALPINE_VERSION=3.13
2-
ARG GO_VERSION=1.14.15
2+
ARG GO_VERSION=1.17.3
33
ARG GRPC_GATEWAY_VERSION=1.16.0
44
ARG GRPC_JAVA_VERSION=1.35.0
55
ARG GRPC_CSHARP_VERSION=1.35.0
66
ARG GRPC_VERSION=1.35.0
7-
ARG PROTOC_GEN_GO_VERSION=1.4.3
7+
ARG PROTOC_GEN_GO_VERSION=1.31.0
88
# v1.3.2, using the version directly does not work: "tar: invalid magic"
99
ARG PROTOC_GEN_GOGO_VERSION=b03c65ea87cdc3521ede29f62fe3ce239267c1bc
1010
ARG PROTOC_GEN_LINT_VERSION=0.2.1
@@ -74,13 +74,10 @@ RUN git clone --recursive --depth=1 -b v${GRPC_CSHARP_VERSION} https://github.co
7474

7575
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as go_builder
7676
RUN apk add --no-cache build-base curl git
77+
ENV GOBIN=/out/usr/bin
7778

7879
ARG PROTOC_GEN_GO_VERSION
79-
RUN mkdir -p ${GOPATH}/src/github.com/golang/protobuf && \
80-
curl -sSL https://api.github.com/repos/golang/protobuf/tarball/v${PROTOC_GEN_GO_VERSION} | tar xz --strip 1 -C ${GOPATH}/src/github.com/golang/protobuf &&\
81-
cd ${GOPATH}/src/github.com/golang/protobuf && \
82-
go build -ldflags '-w -s' -o /golang-protobuf-out/protoc-gen-go ./protoc-gen-go && \
83-
install -Ds /golang-protobuf-out/protoc-gen-go /out/usr/bin/protoc-gen-go
80+
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOC_GEN_GO_VERSION}
8481

8582
ARG PROTOC_GEN_GOGO_VERSION
8683
RUN mkdir -p ${GOPATH}/src/github.com/gogo/protobuf && \

0 commit comments

Comments
 (0)