Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ the release.
([#2170](https://github.com/open-telemetry/opentelemetry-demo/pull/2170))
* [chore] bump dependent images
([#2179](https://github.com/open-telemetry/opentelemetry-demo/pull/2179))
* [image-provider]: replace bookworm image with nonroot alpine image
([2193](https://github.com/open-telemetry/opentelemetry-demo/pull/2193))

## 2.0.2

Expand Down
23 changes: 14 additions & 9 deletions src/image-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

FROM nginx:1.27.0-otel
FROM nginxinc/nginx-unprivileged:1.27.5-alpine3.21

RUN apt-get update ; apt-get install lsb-release --no-install-recommends --no-install-suggests -y
USER 0

# This file is needed for nginx-module-otel to be found.
RUN echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list
RUN printf "%s%s%s%s\n" \
"@nginx " \
"http://nginx.org/packages/mainline/alpine/v" \
`egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \
"/main" \
| tee -a /etc/apk/repositories

RUN apt-get update ; apt-get install nginx-module-otel --no-install-recommends --no-install-suggests -y
RUN apk update && \
apk add nginx-module-otel@nginx

RUN mkdir /static
COPY src/image-provider/static /static
USER 101

COPY src/image-provider/static/ /static/
COPY src/image-provider/nginx.conf.template /nginx.conf.template

EXPOSE ${IMAGE_PROVIDER_PORT}

STOPSIGNAL SIGQUIT

COPY src/image-provider/nginx.conf.template /nginx.conf.template

# Start nginx
CMD ["/bin/sh" , "-c" , "envsubst '$OTEL_COLLECTOR_HOST $IMAGE_PROVIDER_PORT $OTEL_COLLECTOR_PORT_GRPC $OTEL_SERVICE_NAME' < /nginx.conf.template > /etc/nginx/nginx.conf && cat /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"]
2 changes: 2 additions & 0 deletions src/image-provider/nginx.conf.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
load_module modules/ngx_otel_module.so;

pid /tmp/nginx.pid;

events {
worker_connections 1024;
}
Expand Down