Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-python . /
COPY --from=stagex/core-py-flit . /
COPY --from=stagex/core-py-gpep517 . /
COPY --from=stagex/core-zlib . /
ADD fetch/py-prompt_toolkit-${VERSION}.tar.gz .
WORKDIR /prompt_toolkit-${VERSION}/src
RUN --network=none <<-EOF
set -eu
sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"
mkdir -p "/rootfs/${sitedir}"
cp -a prompt_toolkit "/rootfs/$sitedir"
find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /