summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/opentelemetry-cpp/docker/Dockerfile
blob: 118cac62f90d6f6e3ecb8510329158d53a3e2c7f (plain)
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
ARG BASE_IMAGE=ubuntu:latest
ARG GRPC_IMAGE=grpc-${BASE_IMAGE}
ARG THRIFT_IMAGE=thrift-${BASE_IMAGE}

FROM ${GRPC_IMAGE} as grpc
FROM ${THRIFT_IMAGE} as thrift

FROM base-${BASE_IMAGE}-dev AS otel-cpp

ARG CORES=${nproc}
ARG OTEL_GIT_TAG=v1.3.0

COPY --from=grpc / /usr/local
COPY --from=thrift / /usr/local

#install opentelemetry-cpp
RUN git clone --recurse-submodules -j ${CORES} --depth=1 \
    -b ${OTEL_GIT_TAG} https://github.com/open-telemetry/opentelemetry-cpp.git \
    && cd opentelemetry-cpp \
    && mkdir -p build && cd build \
    && cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE  \
        -DWITH_ZIPKIN=ON \
        -DWITH_JAEGER=ON \
        -DCMAKE_INSTALL_PREFIX=/opt/third_party/install \
        -DBUILD_TESTING=OFF \
        -DWITH_OTLP=ON \
        -DWITH_OTLP_GRPC=ON \
        -DBUILD_SHARED_LIBS=ON \
        .. \
    && cmake --build . -j ${CORES} --target install

FROM scratch as final

COPY --from=otel-cpp /opt/third_party/install /