-
Notifications
You must be signed in to change notification settings - Fork 392
/
Copy pathDockerfile.fedora-install
117 lines (104 loc) · 4.69 KB
/
Dockerfile.fedora-install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG DISTRO_VERSION=31
FROM fedora:${DISTRO_VERSION}
ARG NCPU=4
# Fedora includes packages for gRPC, libcurl, and OpenSSL that are recent enough
# for `google-cloud-cpp`. Install these packages and additional development
# tools to compile the dependencies:
RUN dnf makecache && \
dnf install -y abi-compliance-checker abi-dumper \
clang clang-tools-extra cmake diffutils doxygen findutils gcc-c++ git \
grpc-devel grpc-plugins libcxx-devel libcxxabi-devel libcurl-devel \
make ninja-build openssl-devel pkgconfig protobuf-compiler python3 python3-pip \
ShellCheck tar unzip w3m wget which zlib-devel
# Install the the buildifier tool, which does not compile with the default
# golang compiler for Ubuntu 16.04 and Ubuntu 18.04.
RUN wget -q -O /usr/bin/buildifier https://github.com/bazelbuild/buildtools/releases/download/0.29.0/buildifier
RUN chmod 755 /usr/bin/buildifier
# Install shfmt to automatically format the Shell scripts.
RUN curl -L -o /usr/local/bin/shfmt \
"https://github.com/mvdan/sh/releases/download/v3.1.0/shfmt_v3.1.0_linux_amd64" && \
chmod 755 /usr/local/bin/shfmt
# Install cmake_format to automatically format the CMake list files.
# https://github.com/cheshirekow/cmake_format
# Pin this to an specific version because the formatting changes when the
# "latest" version is updated, and we do not want the builds to break just
# because some third party changed something.
RUN pip3 install --upgrade pip
RUN pip3 install cmake_format==0.6.8
# Install black to automatically format the Python files.
RUN pip3 install black==19.3b0
# Install the Python modules needed to run the storage testbench
RUN dnf makecache && dnf install -y python3-devel
RUN pip3 install setuptools
RUN pip3 install flask==1.1.1 Werkzeug==1.0.0 httpbin==0.7.0 \
gevent==1.4.0 gunicorn==19.10.0 crc32c==2.0
# Install Abseil, remove the downloaded files and the temporary artifacts
# after a successful build to keep the image smaller (and with fewer layers)
WORKDIR /var/tmp/build
RUN curl -sSL https://github.com/abseil/abseil-cpp/archive/20200225.2.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=yes \
-H. -Bcmake-out/abseil && \
cmake --build cmake-out/abseil --target install -- -j ${NCPU} && \
ldconfig && \
cd /var/tmp && rm -fr build
# Install googletest, remove the downloaded files and the temporary artifacts
# after a successful build to keep the image smaller (and with fewer layers)
WORKDIR /var/tmp/build
RUN curl -sSL https://github.com/google/googletest/archive/release-1.10.0.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=yes \
-H. -Bcmake-out/googletest && \
cmake --build cmake-out/googletest --target install -- -j ${NCPU} && \
ldconfig && \
cd /var/tmp && rm -fr build
# Download and compile Google microbenchmark support library:
WORKDIR /var/tmp/build
RUN curl -sSL https://github.com/google/benchmark/archive/v1.5.0.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=yes \
-DBENCHMARK_ENABLE_TESTING=OFF \
-H. -Bcmake-out/benchmark && \
cmake --build cmake-out/benchmark --target install -- -j ${NCPU} && \
ldconfig && \
cd /var/tmp && rm -fr build
WORKDIR /var/tmp/build
RUN curl -sSL https://github.com/google/crc32c/archive/1.1.0.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=yes \
-DCRC32C_BUILD_TESTS=OFF \
-DCRC32C_BUILD_BENCHMARKS=OFF \
-DCRC32C_USE_GLOG=OFF \
-H. -Bcmake-out/crc32c && \
cmake --build cmake-out/crc32c --target install -- -j ${NCPU} && \
ldconfig && \
cd /var/tmp && rm -fr build
# Install the Cloud Bigtable emulator and the Cloud Bigtable command-line
# client. They are used in the integration tests.
COPY . /var/tmp/ci
WORKDIR /var/tmp/downloads
RUN /var/tmp/ci/install-cloud-sdk.sh
# Install Bazel because some of the builds need it.
RUN /var/tmp/ci/install-bazel.sh