forked from googleapis/google-cloud-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo-fedora.Dockerfile
More file actions
102 lines (83 loc) · 3.51 KB
/
demo-fedora.Dockerfile
File metadata and controls
102 lines (83 loc) · 3.51 KB
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
# Copyright 2021 Google LLC
#
# 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
#
# https://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.
FROM fedora:40
ARG NCPU=4
## [BEGIN packaging.md]
# Install the minimal development tools:
# ```bash
RUN dnf makecache && \
dnf install -y cmake curl findutils gcc-c++ git make ninja-build \
patch unzip tar wget zip
# ```
# Fedora:40 includes packages, with recent enough versions, for most of the
# direct dependencies of `google-cloud-cpp`.
# ```bash
RUN dnf makecache && \
dnf install -y protobuf-compiler protobuf-devel grpc-cpp grpc-devel \
json-devel libcurl-devel openssl-devel
# ```
# #### Patching pkg-config
# If you are not planning to use `pkg-config(1)` you can skip these steps.
# Fedora's version of `pkg-config` (https://github.com/pkgconf/pkgconf) is slow
# when handling `.pc` files with lots of `Requires:` deps, which happens with
# Abseil. If you plan to use `pkg-config` with any of the installed artifacts,
# you may want to use a recent version of the standard `pkg-config` binary. If
# not, `dnf install pkgconfig` should work.
# ```bash
WORKDIR /var/tmp/build/pkgconf
RUN curl -fsSL https://distfiles.ariadne.space/pkgconf/pkgconf-2.2.0.tar.gz | \
tar -xzf - --strip-components=1 && \
./configure --prefix=/usr --with-system-libdir=/lib64:/usr/lib64 --with-system-includedir=/usr/include && \
make -j ${NCPU:-4} && \
make install && \
ldconfig && cd /var/tmp && rm -fr build
# ```
# The following steps will install libraries and tools in `/usr/local`. By
# default, pkgconf does not search in these directories. We need to explicitly
# set the search path.
# ```bash
ENV PKG_CONFIG_PATH=/usr/local/share/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig
# ```
# #### opentelemetry-cpp
# The project has an **optional** dependency on the OpenTelemetry library.
# We recommend installing this library because:
# - the dependency will become required in the google-cloud-cpp v3.x series.
# - it is needed to produce distributed traces of the library.
# ```bash
WORKDIR /var/tmp/build/opentelemetry-cpp
RUN curl -fsSL https://github.com/open-telemetry/opentelemetry-cpp/archive/v1.24.0.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=yes \
-DWITH_EXAMPLES=OFF \
-DWITH_STL=CXX17 \
-DBUILD_TESTING=OFF \
-DOPENTELEMETRY_INSTALL=ON \
-DOPENTELEMETRY_ABI_VERSION_NO=2 \
-S . -B cmake-out && \
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
ldconfig
# ```
## [DONE packaging.md]
RUN dnf makecache && dnf install -y gdb
WORKDIR /var/tmp/sccache
RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-x86_64-unknown-linux-musl.tar.gz | \
tar -zxf - --strip-components=1 && \
mkdir -p /usr/local/bin && \
mv sccache /usr/local/bin/sccache && \
chmod +x /usr/local/bin/sccache
# Update the ld.conf cache in case any libraries were installed in /usr/local/lib*
RUN ldconfig /usr/local/lib*