forked from googleapis/google-cloud-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo-opensuse-leap.Dockerfile
More file actions
93 lines (76 loc) · 3.09 KB
/
demo-opensuse-leap.Dockerfile
File metadata and controls
93 lines (76 loc) · 3.09 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
# 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 opensuse/leap:15
ARG NCPU=4
## [BEGIN packaging.md]
# Install the minimal development tools.
# **NOTE:** The default compiler on openSUSE (GCC 7.5.0) crashes while compiling
# some of the files generated by Protobuf. Minor variations in the Protobuf
# version or the libraries changes where the compiler crashes. We recommend you
# use GCC 8 or higher to compile `google-cloud-cpp`.
# ```bash
RUN zypper refresh && \
zypper install --allow-downgrade -y automake cmake curl \
gcc8 gcc8-c++ git gzip libtool make patch tar wget
# ```
# Install some of the dependencies for `google-cloud-cpp`.
# ```bash
RUN zypper refresh && \
zypper install --allow-downgrade -y abseil-cpp-devel c-ares-devel \
libcurl-devel libopenssl-devel nlohmann_json-devel \
grpc-devel libprotobuf-devel
# ```
# The following steps will install libraries and tools in `/usr/local`. openSUSE
# does not search for shared libraries in these directories by default. There
# are multiple ways to solve this problem, the following steps are one solution:
# ```bash
RUN (echo "/usr/local/lib" ; echo "/usr/local/lib64") | \
tee /etc/ld.so.conf.d/usrlocal.conf
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
ENV PATH=/usr/local/bin:${PATH}
# ```
# Use the following environment variables to configure the compiler used by
# CMake.
ENV CC=gcc-8
ENV CXX=g++-8
# #### opentelemetry-cpp
# The project has a dependency on the OpenTelemetry 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 zypper refresh && \
zypper install --allow-downgrade -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*