diff --git a/services/base-image/Dockerfile b/services/base-image/Dockerfile index 507c41525..acff7797d 100644 --- a/services/base-image/Dockerfile +++ b/services/base-image/Dockerfile @@ -1,35 +1,39 @@ FROM ubuntu:20.04 ENV SHELL=/bin/bash RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ cmake \ git \ build-essential \ autoconf \ libtool \ pkg-config \ libboost-all-dev \ libfmt-dev \ + libgflags-dev \ libgtest-dev \ libcurl4-openssl-dev \ libssl-dev \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /transferred/scripts WORKDIR /transferred/scripts COPY docker/install_grpc.sh . RUN ./install_grpc.sh COPY docker/install_aws_sdk.sh . RUN ./install_aws_sdk.sh COPY docker/install_glog.sh . RUN ./install_glog.sh +COPY docker/install_double.sh . +RUN ./install_double.sh + COPY docker/install_folly.sh . RUN ./install_folly.sh CMD /bin/bash diff --git a/services/base-image/docker/install_aws_sdk.sh b/services/base-image/docker/install_aws_sdk.sh index a54639517..4bb26a16a 100755 --- a/services/base-image/docker/install_aws_sdk.sh +++ b/services/base-image/docker/install_aws_sdk.sh @@ -1,15 +1,21 @@ #!/usr/bin/env bash set -e cd /tmp -git clone --recurse-submodules -b 1.9.176 --single-branch https://github.com/aws/aws-sdk-cpp +git clone https://github.com/aws/aws-sdk-cpp \ + --recurse-submodules \ + -b 1.9.176 \ + --single-branch + mkdir aws-sdk-cpp/build pushd aws-sdk-cpp/build -cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/aws_sdk -DBUILD_ONLY="core;s3;dynamodb" -make -make install +cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=/usr/local/aws_sdk \ + -DBUILD_ONLY="core;s3;dynamodb" +make install -l "$(nproc)" -j "$(nproc)" popd # aws-sdk-cpp/build rm -rf aws-sdk-cpp diff --git a/services/base-image/docker/install_double.sh b/services/base-image/docker/install_double.sh new file mode 100755 index 000000000..4976f68dc --- /dev/null +++ b/services/base-image/docker/install_double.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +pushd /usr/lib + +git clone https://github.com/google/double-conversion.git \ + --branch v3.1.5 --single-branch +pushd double-conversion +cmake . -DBUILD_SHARED_LIBS=ON +make install -l "$(nproc)" -j "$(nproc)" + +popd # double-conversion +rm -r double-conversion + +popd diff --git a/services/base-image/docker/install_folly.sh b/services/base-image/docker/install_folly.sh index 6370e5c44..7f323177d 100755 --- a/services/base-image/docker/install_folly.sh +++ b/services/base-image/docker/install_folly.sh @@ -1,10 +1,17 @@ #!/usr/bin/env bash set -e pushd /usr/lib -git clone https://github.com/facebook/folly.git --branch v2020.01.13.00 --single-branch -git clone https://github.com/google/double-conversion.git --branch v3.1.5 --single-branch +git clone https://github.com/facebook/folly.git \ + --branch v2020.01.13.00 \ + --single-branch + +pushd folly +cmake . +make install -l "$(nproc)" -j "$(nproc)" +popd # folly +rm -r folly popd # /usr/lib diff --git a/services/base-image/docker/install_glog.sh b/services/base-image/docker/install_glog.sh index ef0280048..00a75b2b9 100755 --- a/services/base-image/docker/install_glog.sh +++ b/services/base-image/docker/install_glog.sh @@ -1,7 +1,15 @@ #!/usr/bin/env bash set -e pushd /usr/lib git clone https://github.com/google/glog.git --branch v0.4.0 --single-branch + +pushd glog +cmake . -DBUILD_TESTING=OFF +make install -j "$(nproc)" -l "$(nproc)" +popd # glog + +rm -rf glog + popd # /usr/lib diff --git a/services/base-image/docker/install_grpc.sh b/services/base-image/docker/install_grpc.sh index 9c03f8c35..88429ef2b 100755 --- a/services/base-image/docker/install_grpc.sh +++ b/services/base-image/docker/install_grpc.sh @@ -1,51 +1,62 @@ #!/usr/bin/env bash set -e echo "installing grpc..." cd /tmp git clone \ --recurse-submodules \ --single-branch \ -b v1.39.1 \ https://github.com/grpc/grpc pushd grpc mkdir -p cmake/build pushd cmake/build cmake \ -DgRPC_INSTALL=ON \ -DgRPC_SSL_PROVIDER=package \ -DgRPC_ZLIB_PROVIDER=package \ -DgRPC_BUILD_TESTS=OFF \ -DgRPC_BUILD_CSHARP_EXT=OFF \ -DgRPC_BUILD_GRPC_CPP_PLUGIN=ON \ -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \ ../.. -make -make install +make install -j "$(nproc)" -l "$(nproc)" popd # cmake/build # Explicitly install abseil-cpp because of https://github.com/grpc/grpc/issues/25949 # This should be removed after upgrading to v1.41 pushd third_party/abseil-cpp/ mkdir -p cmake/build pushd cmake/build cmake \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ ../.. -make -make install +make install -j "$(nproc)" -l "$(nproc)" popd # cmake/build popd # third_party/abseil-cpp/ +# Explicitly install a more up-to-date version of `protobuf`, which +# installs `protobuf-config.cmake`. The `libprotobuf-dev` Ubuntu package +# only exports the `pkg-config` `protobuf.pc`. This is important because +# the gRPC CMake configuration will attempt to find the `protobuf` CMake +# configuration. +pushd third_party/protobuf/ +mkdir -p _build +pushd _build +cmake ../cmake -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_ABSL_PROVIDER=package +make install -j "$(nproc)" -l "$(nproc)" +popd # _build +popd # third_party/protobuf/ + popd # grpc rm -rf grpc