ARG NGINX_VERSION=1.25.4 FROM docker.io/debian:bookworm AS builder ARG NGINX_VERSION RUN apt-get -y update && apt-get -y install git build-essential wget libxslt1-dev libpcre2-dev zlib1g-dev \ && mkdir /src && cd /src \ && wget -qO - https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz | tar zxfv - \ && git clone https://github.com/arut/nginx-dav-ext-module.git \ && git clone https://github.com/openresty/headers-more-nginx-module.git RUN cd /src/nginx-${NGINX_VERSION} && ./configure --with-compat \ --with-file-aio --with-threads \ --add-dynamic-module=../nginx-dav-ext-module \ --add-dynamic-module=../headers-more-nginx-module \ && make modules FROM docker.io/nginx:${NGINX_VERSION}-bookworm ARG NGINX_VERSION COPY --from=builder /src/nginx-${NGINX_VERSION}/objs/ngx_http_dav_ext_module.so /usr/lib/nginx/modules/ COPY --from=builder /src/nginx-${NGINX_VERSION}/objs/ngx_http_headers_more_filter_module.so /usr/lib/nginx/modules/