Skip to content

Commit 7011736

Browse files
committed
Use pre-compiled version of UPX.
1 parent 0bfb5d7 commit 7011736

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ ARG LIBMAXMINDDB_URL=https://github.com/maxmind/libmaxminddb/releases/download/$
2323
# Get Dockerfile cross-compilation helpers.
2424
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
2525

26-
# Get Python cryptography wheel. It is needed for certbot.
26+
# Get Python cryptography wheel. It is needed for certbot.
2727
FROM moonbuggy2000/python-musl-wheels:cryptography43.0.0-py3.11-${TARGETARCH}${TARGETVARIANT} AS mod_cryptography
2828

29-
# Build UPX.
30-
FROM --platform=$BUILDPLATFORM alpine:3.18 AS upx
31-
RUN apk --no-cache add build-base curl make cmake git && \
29+
# Get UPX (statically linked).
30+
# NOTE: UPX 5.x is not compatible with old kernels, e.g. 3.10 used by some
31+
# Synology NASes. See https://github.com/upx/upx/issues/902
32+
FROM --platform=$BUILDPLATFORM alpine:3.20 AS upx
33+
ARG UPX_VERSION=4.2.4
34+
RUN apk --no-cache add curl && \
3235
mkdir /tmp/upx && \
33-
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 && \
34-
make -C /tmp/upx build/release-gcc -j$(nproc) && \
35-
cp -v /tmp/upx/build/release-gcc/upx /usr/bin/upx
36+
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 && \
37+
cp -v /tmp/upx/upx /usr/bin/upx
3638

3739
# Build Nginx Proxy Manager.
3840
FROM --platform=$BUILDPLATFORM alpine:3.18 AS npm
@@ -103,10 +105,10 @@ RUN \
103105
&& \
104106
# Install pip.
105107
# NOTE: pip from the Alpine package repository is debundled, meaning that
106-
# its dependencies are part of the system-wide ones. This save a lot
108+
# its dependencies are part of the system-wide ones. This save a lot
107109
# of space, but these dependencies conflict with the ones required by
108110
# Certbot plugins. Thus, we need to manually install pip (with its
109-
# built-in dependencies). See:
111+
# built-in dependencies). See:
110112
# https://pip.pypa.io/en/stable/development/vendoring-policy/
111113
curl -# -L "https://bootstrap.pypa.io/get-pip.py" | python3
112114

0 commit comments

Comments
 (0)