Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install on Docker nginx image #30

Closed
bmerigan opened this issue Jan 18, 2024 · 9 comments
Closed

Unable to install on Docker nginx image #30

bmerigan opened this issue Jan 18, 2024 · 9 comments

Comments

@bmerigan
Copy link

Describe the bug

Cannot install this module into the official Docker nginx images.
Have tried both nginxinc/nginx-unprivileged:1.25.3 and nginx:1.25.3
Receive error message Unable to locate package nginx-module-otel when trying to build the Docker container, as shown below.

 > [gateway 2/9] RUN apt update && apt install nginx-module-otel:
0.831
0.831 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
0.831
1.185 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
1.330 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
1.524 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
1.911 Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8787 kB]
5.141 Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [12.7 kB]
5.345 Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [134 kB]
10.69 Fetched 9185 kB in 10s (949 kB/s)
10.69 Reading package lists...
14.53 Building dependency tree...
16.01 Reading state information...
16.18 All packages are up to date.
16.23
16.23 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
16.23
16.24 Reading package lists...
20.54 Building dependency tree...
21.51 Reading state information...
21.56 E: Unable to locate package nginx-module-otel

To reproduce

Steps to reproduce the behavior:
Try to install this otel module in an official nginx Docker container using the most basic Dockerfile.

Dockerfile:

FROM nginx:1.25.3

RUN apt update \
&& apt install nginx-module-otel

CMD sh -c 'nginx -g "daemon off;"'

docker-compose up -d gateway --build

Expected behavior

I expect the module to install.

Your environment

nginx official docker image 1.25.3
https://hub.docker.com/layers/library/nginx/1.25.3/images/sha256-161ef4b1bf7effb350a2a9625cb2b59f69d54ec6059a8a155a1438d0439c593c?context=explore

Additional context

@thresheek
Copy link

Hi @bmerigan !

We're removing the sources.list entry when we finalize the dockerfile: https://github.com/nginxinc/docker-nginx/blob/master/mainline/debian/Dockerfile#L95

To install the otel module, you'd need to re-add the sources.list entry for the repo (no need for a key).

@bmerigan
Copy link
Author

Ah, I see. I guess that's to keep sizes down and unlikely to change.
Thanks for the info.

@thresheek
Copy link

To be fair we didnt have any other request to change this behaviour, so yeah, unlikely to change.

In any case, I plan to have the official otel-enabled image published soon, so this issue will be fixed properly.

@bmerigan
Copy link
Author

With the nudge in the right direction I have replaced the missing file and it installed ok.
And I'll keep a lookout for the new image.
Thanks.

@zakimaksyutov
Copy link

Here is the Dockerfile which successfully installs nginx-module-otel:

FROM nginx:1.25.3

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

# 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 apt-get update ; apt-get install nginx-module-otel --no-install-recommends --no-install-suggests -y

@klucsik
Copy link

klucsik commented Mar 13, 2024

I spent several hours on this already, would be nice to include this to the readme
@zakimaksyutov thank you for the dockerfile, it works

@thresheek
Copy link

FYI I've started a process to include the otel module as one of the variants of the official image: nginxinc/docker-nginx#871

I'll let you know when it's accepted & available.

@thresheek
Copy link

DockerHub image is live.

See https://hub.docker.com/_/nginx, namely "nginx:otel" and "nginx:alpine-otel" for the current tags.

@bmerigan
Copy link
Author

Nice work @thresheek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants