# # Add additionnal modules # FROM --platform=linux/amd64 nginx:latest AS builder ARG TARGETPLATFORM ARG TARGETOS ARG TARGETARCH ARG BUILDPLATFORM ARG BUILDOS ARG BUILDARCH ARG BUILDVARIANT ARG NGINX_VERSION COPY platform.sh . RUN ./platform.sh RUN apt-get update -y && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ libc-dev \ make \ libssl-dev \ libpcre3-dev \ zlib1g-dev \ curl \ gnupg \ libxslt-dev \ libgd-dev \ libgeoip-dev \ wget \ gcc RUN wget --inet4-only "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \ mkdir /tmp/nginx && \ tar -xzvf nginx.tar.gz -C /tmp/nginx --strip-components=1 RUN CONFARGS=$(nginx -V 2>&1 | sed -n -e 's/^.*arguments: //p') \ tar -zxC /usr/src -f nginx.tar.gz && \ cd /usr/src/nginx-$NGINX_VERSION && \ ./configure \ --with-compat $CONFARGS \ --user=nginx \ --with-debug \ --group=nginx \ --prefix=/usr/share/nginx \ --sbin-path=/usr/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --pid-path=/run/nginx.pid \ --lock-path=/run/lock/subsys/nginx \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-http_ssl_module \ --with-pcre \ --with-http_image_filter_module \ --with-file-aio \ --with-ipv6 \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gunzip_module \ --with-threads \ --with-http_ssl_module \ --with-http_v2_module \ --with-http_realip_module \ --with-http_image_filter_module \ --with-http_image_filter_module=dynamic \ --with-http_geoip_module \ --with-http_geoip_module=dynamic \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-stream \ --with-stream=dynamic \ --with-stream_ssl_module \ --with-stream_realip_module \ --with-stream_geoip_module \ --with-stream_geoip_module=dynamic \ --with-stream_ssl_preread_module \ && \ make && \ make install # # Setup Nginx image # FROM --platform=linux/amd64 nginx:latest ARG TARGETPLATFORM ARG TARGETOS ARG TARGETARCH ARG BUILDPLATFORM ARG BUILDOS ARG BUILDARCH ARG BUILDVARIANT COPY --from=builder \ /usr/share/nginx/modules/*.so /usr/lib/nginx/modules/ ADD files/fastcgi.conf /etc/nginx/fastcgi.conf ADD files/nginx.conf /etc/nginx/nginx.conf LABEL author "Olivier Le Bris" LABEL maintainer "zogg" LABEL com.centurylinklabs.watchtower.enable=false LABEL org.opencontainers.image.source "https://zogg.fr" LABEL org.opencontainers.image.licenses MIT