From 0721142dee0e7fbe6e149d7e13b636852d5c978e Mon Sep 17 00:00:00 2001 From: Teresa Noviello Date: Tue, 26 Apr 2022 15:16:16 +0000 Subject: [PATCH 1/3] Install in the web server the latest available nginx tracing --- web/Dockerfile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index ee1b067..4aa5efb 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -5,18 +5,21 @@ WORKDIR /instana RUN apk add --update --no-cache curl -RUN if [ -n "$KEY" ]; then curl \ - --output instana.zip \ - --user "_:$KEY" \ - https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/1.1.2/linux-amd64-glibc-nginx-1.20.1.zip && \ - unzip instana.zip && \ - mv glibc-libinstana_sensor.so libinstana_sensor.so && \ - mv glibc-nginx-1.20.1-ngx_http_ot_module.so ngx_http_opentracing_module.so; \ +RUN if [ -n "$KEY" ]; then nginx_version='1.5.0' \ + curl --output index.html --user "_:$KEY" https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/ \ + nginx_version=$(cat index.html |egrep "a href"| tail -1 | awk '{print $2;}'|sed 's/href="//'|sed 's/\/".*//') \ + rm index.html \ + curl \ + --output instana.zip \ + --user "_:$KEY" \ + https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/$nginx_version/linux-amd64-nginx-1.20.1.zip && \ + unzip instana.zip && \ + mv glibc-libinstana_sensor.so libinstana_sensor.so && \ + mv glibc-nginx-1.20.1-ngx_http_ot_module.so ngx_http_opentracing_module.so; \ else echo "KEY not provided. Not adding tracing"; \ - touch dummy.so; \ + touch dummy.so; \ fi - FROM nginx:1.20.1 EXPOSE 8080 From 8575a44f0ff598d1cf7046b2a6d7f774faaa1d83 Mon Sep 17 00:00:00 2001 From: Teresa Noviello Date: Wed, 27 Apr 2022 15:01:24 +0000 Subject: [PATCH 2/3] Revert "Install in the web server the latest available nginx tracing" This reverts commit 0721142dee0e7fbe6e149d7e13b636852d5c978e. --- web/Dockerfile | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index 4aa5efb..ee1b067 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -5,21 +5,18 @@ WORKDIR /instana RUN apk add --update --no-cache curl -RUN if [ -n "$KEY" ]; then nginx_version='1.5.0' \ - curl --output index.html --user "_:$KEY" https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/ \ - nginx_version=$(cat index.html |egrep "a href"| tail -1 | awk '{print $2;}'|sed 's/href="//'|sed 's/\/".*//') \ - rm index.html \ - curl \ - --output instana.zip \ - --user "_:$KEY" \ - https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/$nginx_version/linux-amd64-nginx-1.20.1.zip && \ - unzip instana.zip && \ - mv glibc-libinstana_sensor.so libinstana_sensor.so && \ - mv glibc-nginx-1.20.1-ngx_http_ot_module.so ngx_http_opentracing_module.so; \ +RUN if [ -n "$KEY" ]; then curl \ + --output instana.zip \ + --user "_:$KEY" \ + https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/1.1.2/linux-amd64-glibc-nginx-1.20.1.zip && \ + unzip instana.zip && \ + mv glibc-libinstana_sensor.so libinstana_sensor.so && \ + mv glibc-nginx-1.20.1-ngx_http_ot_module.so ngx_http_opentracing_module.so; \ else echo "KEY not provided. Not adding tracing"; \ - touch dummy.so; \ + touch dummy.so; \ fi + FROM nginx:1.20.1 EXPOSE 8080 From 052279458af3fedf7224f0d42fc54cd6e9ef5e53 Mon Sep 17 00:00:00 2001 From: Teresa Noviello Date: Thu, 28 Apr 2022 13:36:40 +0000 Subject: [PATCH 3/3] Set nginx server version to 1.21.6, allow the download of the latest sensor --- web/Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index ee1b067..1f9ffc1 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -5,19 +5,24 @@ WORKDIR /instana RUN apk add --update --no-cache curl -RUN if [ -n "$KEY" ]; then curl \ +ENV ARTI_PATH='https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/' + +RUN if [ -n "$KEY" ]; then \ + sensor_version=$(curl --user "_:$KEY" ${ARTI_PATH} | grep -o '>[0-9]\+\.[0-9]\+\.[0-9]\+'| cut -f 2 -d '>'|sort -V|tail -1 ); \ + echo "Downloading sensor version ${sensor_version} for Nginx version 1.21.6" ; \ + curl \ --output instana.zip \ --user "_:$KEY" \ - https://artifact-public.instana.io/artifactory/shared/com/instana/nginx_tracing/1.1.2/linux-amd64-glibc-nginx-1.20.1.zip && \ + ${ARTI_PATH}/${sensor_version}/linux-amd64-glibc-nginx-1.21.6.zip && \ unzip instana.zip && \ mv glibc-libinstana_sensor.so libinstana_sensor.so && \ - mv glibc-nginx-1.20.1-ngx_http_ot_module.so ngx_http_opentracing_module.so; \ + mv glibc-nginx-1.21.6-ngx_http_ot_module.so ngx_http_opentracing_module.so; \ else echo "KEY not provided. Not adding tracing"; \ touch dummy.so; \ fi -FROM nginx:1.20.1 +FROM nginx:1.21.6 EXPOSE 8080