FROM ubuntu ENV TZ=Europe/Berlin RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get update && apt-get upgrade --yes && apt-get install --yes build-essential autoconf libtool pkg-config cmake git vim libssl-dev libboost-all-dev # clone gRPC WORKDIR /build ENV GRPC_RELEASE_TAG v1.33.x RUN git clone --depth 1 --recursive -b ${GRPC_RELEASE_TAG} https://github.com/grpc/grpc WORKDIR /build/grpc # install 3rdparty/absl WORKDIR /build/grpc/third_party/abseil-cpp/build RUN cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ .. RUN make -j $(( $(nproc) - 1 )) RUN make install && ldconfig RUN rm -rf /build/grpc/third_party/abseil-cpp # install 3rdparty/c-ares WORKDIR /build/grpc/third_party/cares/cares/build RUN cmake \ -DCMAKE_BUILD_TYPE=Release \ .. RUN make -j $(( $(nproc) - 1 )) RUN make install && ldconfig RUN rm -rf /build/grpc/third_party/cares/cares # install 3rdparty/zlib WORKDIR /build/grpc/third_party/zlib/build RUN cmake \ -DCMAKE_BUILD_TYPE=Release \ .. RUN make -j $(( $(nproc) - 1 )) RUN make install && ldconfig RUN rm -rf /build/grpc/third_party/zlib # install 3rdparty/protobuf WORKDIR /build/grpc/third_party/protobuf/cmake/build RUN cmake \ -Dprotobuf_BUILD_TESTS=OFF \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Release \ .. RUN make -j $(( $(nproc) - 1 )) RUN make install && ldconfig RUN rm -rf /build/grpc/third_party/protobuf # install gRPC WORKDIR /build/grpc/build RUN cmake \ -DCMAKE_BUILD_TYPE=Release \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ -DgRPC_CARES_PROVIDER=package \ -DgRPC_ABSL_PROVIDER=package \ -DgRPC_PROTOBUF_PROVIDER=package \ -DgRPC_SSL_PROVIDER=package \ -DgRPC_ZLIB_PROVIDER=package \ .. RUN make -j $(( $(nproc) - 1 )) RUN make install && ldconfig # install cpprestsdk WORKDIR /build RUN git clone --depth 1 https://github.com/microsoft/cpprestsdk.git WORKDIR cpprestsdk/build RUN cmake .. -DCPPREST_EXCLUDE_WEBSOCKETS=ON RUN make -j $(( $(nproc) - 1 )) RUN make -j $(( $(nproc) - 1 )) install # install etcd-cpp-apiv3 WORKDIR /build/etcd-cpp RUN git clone --depth 1 https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3.git WORKDIR etcd-cpp-apiv3/build RUN cmake \ -DBUILD_ETCD_TESTS=1 \ .. RUN make -j $(( $(nproc) - 1 )) RUN make -j $(( $(nproc) - 1 )) install # WORKDIR /app # COPY app ./