forked from nginxinc/nginx-otel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_otel
34 lines (27 loc) · 947 Bytes
/
Dockerfile_otel
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
# Stage 1: Build OpenTelemetry Module
FROM debian:latest AS build-otel-module
# Install dependencies
RUN apt-get update && \
apt-get install -y cmake libc-ares-dev g++ libre2-dev mercurial curl perl git libssl-dev zlib1g-dev libpcre3 libpcre3-dev
RUN apt-get install -y perl-modules cpanminus
RUN cpan Crypt::Misc
RUN cpan Net::SSLeay
RUN cpan IO::Socket::SSL
# Clone nginx repository
RUN hg clone http://hg.nginx.org/nginx/ /nginx
# Configure nginx
WORKDIR /nginx
RUN ./auto/configure --with-compat
# Clone ngx_otel_module repository
WORKDIR /
RUN git clone https://github.com/nginxinc/nginx-otel.git /nginx-otel
# Create build directory
RUN mkdir -p /nginx-otel/build
# Build module
WORKDIR /nginx-otel/build
RUN cmake -DNGX_OTEL_NGINX_BUILD_DIR=/nginx/objs -DNGX_OTEL_DEV=ON .. && \
make -j 4 && \
strip ngx_otel_module.so
# Archive module
RUN mkdir -p /artifacts && \
cp /nginx-otel/build/ngx_otel_module.so /artifacts/