Files
protoc-docker/Dockerfile
2020-11-23 21:54:39 +10:30

37 lines
1.5 KiB
Docker

FROM vato.ddns.net:8083/debian:buster AS CGRPC_BUILDER
ARG CGRPC_VERSION=v1.33.2
RUN apt update -y && apt install git build-essential autoconf libtool pkg-config zlib1g-dev -y
RUN git clone -b ${CGRPC_VERSION} --recursive https://github.com/grpc/grpc
RUN cd grpc && make plugins -j 12
FROM vato.ddns.net:8083/alpine
ARG ARCH=x86_64
ARG PROTOC_VERSION=3.14.0
ARG GRPC_WEB_VERSION=1.2.1
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk && \
apk add glibc-2.32-r0.apk
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -O protoc.zip && \
unzip protoc.zip -d /usr/ && \
chmod +x /usr/bin/protoc && \
rm protoc.zip /usr/readme.txt
RUN wget https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-linux-${ARCH} && \
wget https://github.com/grpc/grpc-web/releases/download/${GRPC_WEB_VERSION}/protoc-gen-grpc-web-${GRPC_WEB_VERSION}-linux-${ARCH}.sha256 && \
cat protoc-gen-grpc-web-*.sha256 | sha256sum -c
RUN rm protoc-gen-grpc-web-*.sha256 && \
mv protoc-gen-grpc-web-* /usr/bin/protoc-gen-grpc-web && \
chmod +x /usr/bin/protoc-gen-grpc-web
COPY ./protoc-gen-* /usr/bin/
COPY --from=CGRPC_BUILDER /grpc/bins/opt/grpc_python_plugin /usr/bin/protoc-gen-grpc-python