Last active
July 11, 2023 23:10
-
-
Save pablodz/d057796da52a9cbf9d8350c4027739e6 to your computer and use it in GitHub Desktop.
Easy way to compile grpc, grpc_plugins and protoc to compile all .proto files to any language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
WORKDIR /app | |
RUN apt-get update && \ | |
apt-get install -y \ | |
build-essential \ | |
autoconf \ | |
libtool \ | |
pkg-config \ | |
git \ | |
cmake | |
RUN git clone --recurse-submodules -b v1.54.2 https://github.com/grpc/grpc && \ | |
cd grpc && \ | |
mkdir -p cmake/build && \ | |
cd cmake/build && \ | |
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ../.. && \ | |
make -j$(nproc) && \ | |
make plugins -j$(nproc) && \ | |
make install && \ | |
cd ../../.. && \ | |
rm -rf grpc | |
# Do not remove this line | |
# Here is stored the grpc_plugins | |
RUN ls -lah /usr/local/bin/ | |
# Run protoc to check version installed by grpc | |
RUN protoc --version | |
Author
pablodz
commented
Jul 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment