Skip to content

Commit 3762b51

Browse files
committed
Update OpenTracing
1 parent dbf87b8 commit 3762b51

File tree

3 files changed

+13
-65
lines changed

3 files changed

+13
-65
lines changed

build/Dockerfile

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -152,79 +152,29 @@ RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode
152152
# RUN update-ca-trust extract
153153

154154

155-
############################################# Build image for Opentracing Builder #############################################
156-
FROM debian as opentracing-builder
157-
ARG NGINX_OPENTRACING=0.10.0
158-
ARG OPENTRACING_VERSION=1.6.0
159-
160-
RUN apt-get update && apt-get install -y -q --fix-missing --no-install-recommends \
161-
autoconf \
162-
automake \
163-
build-essential \
164-
cmake \
165-
git \
166-
libcurl4-openssl-dev \
167-
libgeoip-dev \
168-
liblmdb-dev \
169-
libpcre3-dev \
170-
libprotobuf-dev \
171-
libssl-dev \
172-
libtool \
173-
libxml2-dev \
174-
libyajl-dev \
175-
pkgconf \
176-
protobuf-compiler \
177-
zlib1g-dev
178-
179-
# Get nginx to build against
180-
RUN curl -sS -O -L http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz \
181-
&& tar zxvf nginx-${NGINX_VERSION}.tar.gz && rm -f nginx-${NGINX_VERSION}.tar.gz \
182-
&& git clone --branch v${NGINX_OPENTRACING} https://github.com/opentracing-contrib/nginx-opentracing.git \
183-
&& git clone --branch v${OPENTRACING_VERSION} https://github.com/opentracing/opentracing-cpp.git
184-
185-
WORKDIR /opentracing-cpp/.build
186-
RUN cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DBUILD_STATIC_LIBS=OFF -DBUILD_MOCKTRACER=OFF -DENABLE_LINTING=OFF .. && \
187-
make && make install
188-
189-
WORKDIR /nginx-${NGINX_VERSION}
190-
RUN ./configure \
191-
--with-compat --with-debug \
192-
--add-dynamic-module=/nginx-opentracing/opentracing && \
193-
make modules
194-
195-
196-
############################################# Build image for Trace downloader #############################################
197-
FROM debian AS tracer-downloader
198-
199-
ARG JAEGER_VERSION=v0.4.2
200-
201-
RUN apt-get update \
202-
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates apt-transport-https wget \
203-
&& wget -nv https://github.com/jaegertracing/jaeger-client-cpp/releases/download/${JAEGER_VERSION}/libjaegertracing_plugin.linux_amd64.so -O /usr/local/lib/libjaegertracing_plugin.so
155+
############################################# Base images containing libs for Opentracing #############################################
156+
FROM opentracing/nginx-opentracing:nginx-1.21.6 as opentracing-lib
204157

205158

206-
############################################# Build image for Opentracing #############################################
159+
############################################# Build image for Debian with Opentracing #############################################
207160
FROM debian as opentracing
208-
ARG OPENTRACING_VERSION=1.6.0
209161

210-
COPY --from=opentracing-builder /nginx-${NGINX_VERSION}/objs/ngx_http_opentracing_module.so /usr/lib/nginx/modules/ngx_http_opentracing_module.so
211-
COPY --from=opentracing-builder /usr/local/lib/libopentracing.so.${OPENTRACING_VERSION} /usr/local/lib/libopentracing.so.1
212-
COPY --from=tracer-downloader /usr/local/lib/libjaegertracing_plugin.so /usr/local/lib/libjaegertracing_plugin.so
213-
214-
RUN ldconfig
162+
RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ cp -av /tmp/usr/local/lib/libopentracing.so* /tmp/usr/local/lib/libjaegertracing*so* /tmp/usr/local/lib/libzipkin*so* /tmp/usr/local/lib/libdd*so* /tmp/usr/local/lib/libyaml*so* /usr/local/lib/ \
163+
&& cp -av /tmp/usr/lib/nginx/modules/ngx_http_opentracing_module.so /usr/lib/nginx/modules/ \
164+
&& ldconfig
215165

216166

217167
############################################# Build image for Opentracing with NGINX Plus #############################################
218168
FROM debian-plus as opentracing-plus
219-
ARG NGINX_PLUS_VERSION
220169

221170
RUN --mount=type=secret,id=nginx-repo.crt,dst=/etc/ssl/nginx/nginx-repo.crt,mode=0644 \
222171
--mount=type=secret,id=nginx-repo.key,dst=/etc/ssl/nginx/nginx-repo.key,mode=0644 \
223172
apt-get update \
224-
&& apt-get install --no-install-recommends --no-install-suggests -y nginx-plus-module-opentracing-${NGINX_PLUS_VERSION} \
173+
&& apt-get install --no-install-recommends --no-install-suggests -y libcurl4 nginx-plus-module-opentracing \
225174
&& rm -rf /var/lib/apt/lists/*
226175

227-
COPY --from=tracer-downloader /usr/local/lib/libjaegertracing_plugin.so /usr/local/lib/libjaegertracing_plugin.so
176+
RUN --mount=type=bind,from=opentracing-lib,target=/tmp/ cp -av /tmp/usr/local/lib/libjaegertracing*so* /tmp/usr/local/lib/libzipkin*so* /tmp/usr/local/lib/libdd*so* /tmp/usr/local/lib/libyaml*so* /usr/local/lib/ \
177+
&& ldconfig
228178

229179

230180
############################################# Create common files for NGINX Plus #############################################

docs-web/technical-specifications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The supported architecture is x86-64.
3535
- ``nginx/nginx-ingress:1.12.3-alpine``
3636
* - Debian-based image with Opentracing
3737
- ``nginx:1.21.6``, which is based on ``debian:buster-slim``
38-
- OpenTracing API for C++ 1.5.1, NGINX plugin for OpenTracing, C++ OpenTracing binding for Jaeger 0.4.2
38+
- NGINX OpenTracing module, OpenTracing library, OpenTracing tracers for Jaeger, Zipkin and Datadog
3939
-
4040
* - Ubi-based image
4141
- ``registry.access.redhat.com/ubi8/ubi:8.3``
@@ -65,7 +65,7 @@ NGINX Plus images are not available through DockerHub.
6565
-
6666
* - Debian-based image with Opentracing
6767
- ``debian:buster-slim``
68-
- NGINX Plus OpenTracing module, C++ OpenTracing binding for Jaeger 0.4.2
68+
- NGINX Plus OpenTracing module, OpenTracing tracers for Jaeger, Zipkin and Datadog
6969
* - Ubi-based image
7070
- ``registry.access.redhat.com/ubi8/ubi:8.3``
7171
-

docs-web/third-party-modules/opentracing.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ This document explains how to use OpenTracing with the Ingress Controller.
77
**Note**: The examples below use the snippets annotations, which are disabled by default. To use snippets, set the [`enable-snippets`](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments#cmdoption-enable-snippets) command-line argument.
88

99
## Prerequisites
10-
1. **Use the Ingress Controller image with OpenTracing.** The default Ingress Controller images don’t include the OpenTracing module. To use OpenTracing, you need to build the image with that module. Follow the build instructions to build the image using `openshift-image` for NGINX or `openshift-image-plus` for NGINX Plus.
11-
By default, the Dockerfiles install Jaeger as a tracer. However, it is possible to replace Jaeger with other supported [tracers](https://github.com/opentracing-contrib/nginx-opentracing#building-from-source). For that, please modify the Dockerfile accordingly:
12-
1. Change the download line in the tracer-downloader stage of the Dockerfile to download the right tracer.
13-
1. Edit the COPY line of the final image to copy the previously downloaded tracer to the image
10+
1. **Use the Ingress Controller image with OpenTracing.** You can find the images with NGINX or NGINX Plus with OpenTracing listed [here](/nginx-ingress-controller/technical-specifications/#supported-docker-images). Alternatively, you can follow the build instructions to build the image using `debian-image-opentracing` for NGINX or `debian-image-opentracing-plus` for NGINX Plus.
11+
[Jaeger](https://github.com/jaegertracing/jaeger-client-cpp), [Zipkin](https://github.com/rnburn/zipkin-cpp-opentracing) and [Datadog](https://github.com/DataDog/dd-opentracing-cpp/) tracers are installed by default.
1412

1513
1. **Load the OpenTracing module.** You need to load the module with the configuration for the chosen tracer using the following ConfigMap keys:
1614
* `opentracing-tracer`: sets the path to the vendor tracer binary plugin. This is the path you used in the COPY line of step *ii* above.

0 commit comments

Comments
 (0)