Files
Quentin Kaiser 4afcf88895 fix(docker): build lzfse wheels at build time
Compile lzfse with temporary C build dependencies on Python 3.14, then
purge them from the final image.

A fix to get lzfse to publish 3.13/3.14 wheels has been opened for 2
months now, see m1stadev/lzfse#1

Fixes #1629
2026-09-15 11:07:41 +02:00

29 lines
992 B
Docker

FROM python:3.14-slim-bookworm
RUN mkdir -p /data/input /data/output
RUN useradd -m unblob
RUN chown -R unblob /data
WORKDIR /data/output
# Enable backports, required to get upx package
RUN printf "deb http://deb.debian.org/debian bookworm-backports main\n" \
> /etc/apt/sources.list.d/backports.list
COPY install-deps.sh /
RUN sh -xeu /install-deps.sh
# You MUST do an uv build before to have the wheel to copy & install here (CI action will do this when building)
COPY dist/*.whl /tmp/
# lzfse has no CPython 3.14 wheel, so pip must compile it from source. Keep the
# compiler in this layer only; the extracted extension remains after it is purged.
RUN pip --disable-pip-version-check install --upgrade pip \
&& apt-get update \
&& apt-get install --no-install-recommends -y gcc libc6-dev \
&& pip install /tmp/unblob*.whl --prefix /usr/local \
&& apt-get purge --auto-remove -y gcc libc6-dev \
&& rm -rf /var/lib/apt/lists/*
USER unblob
ENTRYPOINT ["unblob"]