Source
FROM stagex/pallet-python AS build
ARG VERSION
COPY --from=stagex/pallet-gcc-gnu-busybox . /
COPY --from=stagex/core-py-cffi . /
COPY --from=stagex/core-py-pep517 . /
COPY --from=stagex/user-glibc . /
COPY --from=stagex/user-libsodium . /
COPY --from=stagex/user-py-pycparser . /
ADD fetch/pynacl-${VERSION}.tar.gz .
WORKDIR /pynacl-${VERSION}
ENV SODIUM_INSTALL=system
ENV CFLAGS="-s"
RUN --network=none <<-EOF
set -eu
python -m build --wheel --no-isolation
python -m installer --destdir=/rootfs dist/*.whl
install -Dm0644 -t /rootfs/usr/share/licenses/py-pynacl/ LICENSE
find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /