@@ -9,7 +9,7 @@ ARG DOCKER_IMAGE_VERSION=
99
1010# Define software versions.
1111ARG OPENRESTY_VERSION=1.27.1.1
12- ARG NGINX_PROXY_MANAGER_VERSION=2.12.1
12+ ARG NGINX_PROXY_MANAGER_VERSION=2.12.3
1313ARG NGINX_HTTP_GEOIP2_MODULE_VERSION=3.3
1414ARG LIBMAXMINDDB_VERSION=1.5.0
1515ARG BCRYPT_TOOL_VERSION=1.1.2
@@ -25,19 +25,21 @@ ARG LIBMAXMINDDB_URL=https://github.com/maxmind/libmaxminddb/releases/download/$
2525# Get Dockerfile cross-compilation helpers.
2626FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
2727
28- # Get Python cryptography wheel. It is needed for certbot.
29- FROM moonbuggy2000/python-musl-wheels:cryptography41 .0.3 -py3.10 -${TARGETARCH}${TARGETVARIANT} AS mod_cryptography
28+ # Get Python cryptography wheel. It is needed for certbot.
29+ FROM moonbuggy2000/python-musl-wheels:cryptography43 .0.0 -py3.11 -${TARGETARCH}${TARGETVARIANT} AS mod_cryptography
3030
31- # Build UPX.
32- FROM --platform=$BUILDPLATFORM alpine:3.16 AS upx
33- RUN apk --no-cache add build-base curl make cmake git && \
31+ # Get UPX (statically linked).
32+ # NOTE: UPX 5.x is not compatible with old kernels, e.g. 3.10 used by some
33+ # Synology NASes. See https://github.com/upx/upx/issues/902
34+ FROM --platform=$BUILDPLATFORM alpine:3.20 AS upx
35+ ARG UPX_VERSION=4.2.4
36+ RUN apk --no-cache add curl && \
3437 mkdir /tmp/upx && \
35- curl -# -L https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-src.tar.xz | tar xJ --strip 1 -C /tmp/upx && \
36- make -C /tmp/upx build/release-gcc -j$(nproc) && \
37- cp -v /tmp/upx/build/release-gcc/upx /usr/bin/upx
38+ curl -# -L https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz | tar xJ --strip 1 -C /tmp/upx && \
39+ cp -v /tmp/upx/upx /usr/bin/upx
3840
3941# Build Nginx Proxy Manager.
40- FROM --platform=$BUILDPLATFORM alpine:3.16 AS npm
42+ FROM --platform=$BUILDPLATFORM alpine:3.18 AS npm
4143ARG TARGETPLATFORM
4244ARG NGINX_PROXY_MANAGER_VERSION
4345ARG NGINX_PROXY_MANAGER_URL
@@ -46,7 +48,7 @@ COPY src/nginx-proxy-manager /build
4648RUN /build/build.sh "$NGINX_PROXY_MANAGER_VERSION" "$NGINX_PROXY_MANAGER_URL"
4749
4850# Build OpenResty (nginx).
49- FROM --platform=$BUILDPLATFORM alpine:3.16 AS nginx
51+ FROM --platform=$BUILDPLATFORM alpine:3.18 AS nginx
5052ARG TARGETPLATFORM
5153ARG OPENRESTY_URL
5254ARG NGINX_HTTP_GEOIP2_MODULE_URL
@@ -57,7 +59,7 @@ RUN /build/build.sh "$OPENRESTY_URL" "$NGINX_HTTP_GEOIP2_MODULE_URL" "$LIBMAXMIN
5759RUN xx-verify /tmp/openresty-install/usr/sbin/nginx
5860
5961# Build bcrypt-tool.
60- FROM --platform=$BUILDPLATFORM alpine:3.16 AS bcrypt-tool
62+ FROM --platform=$BUILDPLATFORM alpine:3.18 AS bcrypt-tool
6163ARG TARGETPLATFORM
6264ARG BCRYPT_TOOL_VERSION
6365COPY --from=xx / /
@@ -68,17 +70,17 @@ COPY --from=upx /usr/bin/upx /usr/bin/upx
6870RUN upx /tmp/go/bin/bcrypt-tool
6971
7072# Build certbot.
71- FROM alpine:3.16 AS certbot
73+ FROM alpine:3.18 AS certbot
7274COPY --from=mod_cryptography / /wheels
7375RUN \
7476 apk --no-cache add build-base curl python3 && \
7577 curl -# -L "https://bootstrap.pypa.io/get-pip.py" | python3 && \
7678 pip install --no-cache-dir --root=/tmp/certbot-install --prefix=/usr --find-links /wheels/ --prefer-binary --only-binary=:all: certbot && \
77- find /tmp/certbot-install/usr/lib/python3.10 /site-packages -type f -name "*.so" -exec strip {} ';' && \
78- find /tmp/certbot-install/usr/lib/python3.10 /site-packages -type f -name "*.h" -delete && \
79- find /tmp/certbot-install/usr/lib/python3.10 /site-packages -type f -name "*.c" -delete && \
80- find /tmp/certbot-install/usr/lib/python3.10 /site-packages -type f -name "*.exe" -delete && \
81- find /tmp/certbot-install/usr/lib/python3.10 /site-packages -type d -name tests -print0 | xargs -0 rm -r
79+ find /tmp/certbot-install/usr/lib/python3.11 /site-packages -type f -name "*.so" -exec strip {} ';' && \
80+ find /tmp/certbot-install/usr/lib/python3.11 /site-packages -type f -name "*.h" -delete && \
81+ find /tmp/certbot-install/usr/lib/python3.11 /site-packages -type f -name "*.c" -delete && \
82+ find /tmp/certbot-install/usr/lib/python3.11 /site-packages -type f -name "*.exe" -delete && \
83+ find /tmp/certbot-install/usr/lib/python3.11 /site-packages -type d -name tests -print0 | xargs -0 rm -r
8284
8385# Build cs-openresty-boucner.
8486FROM alpine:3.16 AS cs-openresty-bouncer
@@ -89,7 +91,7 @@ COPY src/cs-openresty-bouncer /build
8991RUN /build/build.sh "$CROWDSEC_OPENRESTY_BOUNCER_URL"
9092
9193# Pull base image.
92- FROM jlesage/baseimage:alpine-3.16 -v3.6.4
94+ FROM jlesage/baseimage:alpine-3.18 -v3.7.1
9395
9496ARG NGINX_PROXY_MANAGER_VERSION
9597ARG DOCKER_IMAGE_VERSION
@@ -105,7 +107,6 @@ RUN \
105107 python3 \
106108 sqlite \
107109 openssl \
108- apache2-utils \
109110 # For /opt/nginx-proxy-manager/bin/handle-ipv6-setting.
110111 bash \
111112 # For openresty.
@@ -114,10 +115,10 @@ RUN \
114115 && \
115116 # Install pip.
116117 # NOTE: pip from the Alpine package repository is debundled, meaning that
117- # its dependencies are part of the system-wide ones. This save a lot
118+ # its dependencies are part of the system-wide ones. This save a lot
118119 # of space, but these dependencies conflict with the ones required by
119120 # Certbot plugins. Thus, we need to manually install pip (with its
120- # built-in dependencies). See:
121+ # built-in dependencies). See:
121122 # https://pip.pypa.io/en/stable/development/vendoring-policy/
122123 curl -# -L "https://bootstrap.pypa.io/get-pip.py" | python3
123124
0 commit comments