1- ARG ALPINE_VERSION=3.14
2- ARG GO_VERSION=1.17.1
1+ ARG ALPINE_VERSION=3.17
2+ ARG GO_VERSION=1.19.4
33# gRPC core version that applies to C++, C#, Objective-C, PhP, Python, Ruby
44ARG GRPC_VERSION=1.41.0
55ARG PROTOBUF_C_VERSION=1.4.0
@@ -10,10 +10,10 @@ ARG PROTOC_GEN_GO_GRPC_VERSION=1.41.0
1010ARG GRPC_JAVA_VERSION=1.41.0
1111# v1.3.2, using the version directly does not work: "tar: invalid magic"
1212ARG PROTOC_GEN_GOGO_VERSION=b03c65ea87cdc3521ede29f62fe3ce239267c1bc
13- ARG PROTOC_GEN_LINT_VERSION=0.2.4
14- ARG GRPC_GATEWAY_VERSION=2.6 .0
13+ ARG PROTOC_GEN_LINT_VERSION=0.3.0
14+ ARG GRPC_GATEWAY_VERSION=2.15 .0
1515ARG PROTOC_GEN_PARQUET_VERSION=0.4.3
16- ARG UPX_VERSION=3.96
16+ ARG UPX_VERSION=4.0.1
1717
1818
1919FROM alpine:${ALPINE_VERSION} as protoc_builder
@@ -27,16 +27,16 @@ RUN git clone --recursive --depth=1 -b v${GRPC_VERSION} https://github.com/grpc/
2727 mkdir -p /grpc/cmake/build && \
2828 cd /grpc/cmake/build && \
2929 cmake \
30- -GNinja \
31- -DBUILD_SHARED_LIBS=ON \
32- -DCMAKE_INSTALL_PREFIX=/usr \
33- -DCMAKE_BUILD_TYPE=Release \
34- -DgRPC_INSTALL=ON \
35- -DgRPC_BUILD_TESTS=OFF \
36- ../.. && \
30+ -GNinja \
31+ -DBUILD_SHARED_LIBS=ON \
32+ -DCMAKE_INSTALL_PREFIX=/usr \
33+ -DCMAKE_BUILD_TYPE=Release \
34+ -DgRPC_INSTALL=ON \
35+ -DgRPC_BUILD_TESTS=OFF \
36+ ../.. && \
3737 cmake --build . --target plugins && \
3838 cmake --build . --target install && \
39- DESTDIR=/out cmake --build . --target install
39+ DESTDIR=/out cmake --build . --target install
4040
4141ARG PROTOBUF_C_VERSION
4242RUN mkdir -p /protobuf-c && \
@@ -53,11 +53,11 @@ RUN mkdir -p /grpc-java && \
5353 curl -sSL https://api.github.com/repos/grpc/grpc-java/tarball/v${GRPC_JAVA_VERSION} | tar xz --strip 1 -C /grpc-java && \
5454 cd /grpc-java && \
5555 g++ \
56- -I. -I/usr/include \
57- compiler/src/java_plugin/cpp/*.cpp \
58- -L/usr/lib64 \
59- -lprotoc -lprotobuf -lpthread --std=c++0x -s \
60- -o protoc-gen-grpc-java && \
56+ -I. -I/usr/include \
57+ compiler/src/java_plugin/cpp/*.cpp \
58+ -L/usr/lib64 \
59+ -lprotoc -lprotobuf -lpthread --std=c++0x -s \
60+ -o protoc-gen-grpc-java && \
6161 install -Ds protoc-gen-grpc-java /out/usr/bin/protoc-gen-grpc-java && \
6262 rm -Rf /grpc-java && \
6363 rm -Rf /grpc
@@ -103,11 +103,12 @@ RUN mkdir -p ${GOPATH}/src/github.com/gogo/protobuf && \
103103 install -D ./gogoproto/gogo.proto /out/usr/include/github.com/gogo/protobuf/gogoproto/gogo.proto
104104
105105ARG PROTOC_GEN_LINT_VERSION
106+ ARG TARGETARCH
106107RUN cd / && \
107- curl -sSLO https://github.com/ckaznocha/protoc-gen-lint/releases/download/v${PROTOC_GEN_LINT_VERSION}/protoc-gen-lint_linux_amd64 .zip && \
108+ curl -sSLO https://github.com/ckaznocha/protoc-gen-lint/releases/download/v${PROTOC_GEN_LINT_VERSION}/protoc-gen-lint_linux_${TARGETARCH} .zip && \
108109 mkdir -p /protoc-gen-lint-out && \
109110 cd /protoc-gen-lint-out && \
110- unzip -q /protoc-gen-lint_linux_amd64 .zip && \
111+ unzip -q /protoc-gen-lint_linux_${TARGETARCH} .zip && \
111112 install -Ds /protoc-gen-lint-out/protoc-gen-lint /out/usr/bin/protoc-gen-lint
112113
113114ARG GRPC_GATEWAY_VERSION
@@ -134,7 +135,8 @@ FROM alpine:${ALPINE_VERSION} as packer
134135RUN apk add --no-cache curl
135136
136137ARG UPX_VERSION
137- RUN mkdir -p /upx && curl -sSL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz | tar xJ --strip 1 -C /upx && \
138+ ARG TARGETARCH
139+ RUN mkdir -p /upx && curl -sSL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${TARGETARCH}_linux.tar.xz | tar xJ --strip 1 -C /upx && \
138140 install -D /upx/upx /usr/local/bin/upx
139141
140142# Use all output including headers and protoc from protoc_builder
@@ -144,13 +146,13 @@ COPY --from=protoc_builder /out/ /out/
144146COPY --from=go_builder /out/ /out/
145147
146148RUN upx --lzma $(find /out/usr/bin/ \
147- -type f -name 'grpc_*' \
148- -not -name 'grpc_csharp_plugin' \
149- -not -name 'grpc_node_plugin' \
150- -not -name 'grpc_php_plugin' \
151- -not -name 'grpc_ruby_plugin' \
152- -not -name 'grpc_python_plugin' \
153- -or -name 'protoc-gen-*' \
149+ -type f -name 'grpc_*' \
150+ -not -name 'grpc_csharp_plugin' \
151+ -not -name 'grpc_node_plugin' \
152+ -not -name 'grpc_php_plugin' \
153+ -not -name 'grpc_ruby_plugin' \
154+ -not -name 'grpc_python_plugin' \
155+ -or -name 'protoc-gen-*' \
154156 )
155157RUN find /out -name "*.a" -delete -or -name "*.la" -delete
156158
0 commit comments