Skip to content

Starting nginx alpine with additional "headers-more" module fails #1002

@SeA75

Description

@SeA75

Bug Overview

I follow the instruction (https://github.com/nginx/docker-nginx/tree/4bf0763f4977fff7e9648add59e0540088f3ca9f/modules) to add modules to the Nginx Docker image. The module I need is more header.

The result of the build is:

[+] Building 3.3s (13/13) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/nginx:1.28.0-alpine 0.6s
=> [internal] load build context 0.0s
=> => transferring context: 409B 0.0s
=> [stage-1 1/8] FROM docker.io/library/nginx:1.28.0-alpine@sha256:8f2bcf97c473dfe311e79a510ee540ee02e28ce1e6a64e1ef89bfad32574ef10 0.0s
=> CACHED [stage-1 2/8] RUN apk add nginx-mod-http-headers-more 0.0s
=> CACHED [stage-1 3/8] COPY ./backend-not-found.html /var/www/html/backend-not-found.html 0.0s
=> CACHED [stage-1 4/8] COPY ./includes/ /etc/nginx/includes/ 0.0s
=> CACHED [stage-1 5/8] COPY ./ssl/ /etc/ssl/certs/nginx/ 0.0s
=> CACHED [stage-1 6/8] WORKDIR /app 0.0s
=> CACHED [stage-1 7/8] COPY ./default_template.conf . 0.0s
=> CACHED [stage-1 8/8] COPY ./script.sh . 0.0s
=> exporting to image 0.1s
=> => exporting layers 0.0s
=> => writing image sha256:1fce0303cea9f7e6c4dfbb91cc9efbbc4ee7884e877aa4a748f5f715557b8d8f 0.0s
=> => naming to docker.io/library/XXXX-proxy:latest 0.0s

but when i start my docker container I have the issue:

nginx: [emerg] module "/etc/nginx/modules/ngx_http_headers_more_filter_module.so" version 1026003 instead of 1028000 in /etc/nginx/nginx.conf:1

Expected Behavior

The expected behaviors is that container runs correctly

Steps to Reproduce the Bug

Docker file:

FROM openresty/openresty:1.21.4.1-0-alpine
ENV RESTY_CONFIG_OPTIONS_MORE="--with-http_stub_status_module"
FROM nginx:1.28.0-alpine
RUN apk add nginx-mod-http-headers-more

Docker Build:

docker build reverse-proxy --build-arg ENABLED_MODULES="headers-more" -t XXXX-proxy:latest

Environment Details

  • Version/release of Docker: Docker Desktop version Docker version 20.10.8, build 3967b7d
  • Version of the Docker NGINX: nginx:1.28.0-alpine
  • Target deployment platform: Docker Compose
  • Target OS: Linux Debian

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions