Source
FROM scratch AS base
ENV VERSION=1.34.68
ENV SRC_HASH=e7ae9d69cc3e7b31d926e6a1a9ae673ba02da263e35cf12ff2bae35a21755cc6
ENV SRC_FILE=botocore-${VERSION}.tar.gz
ENV SRC_SITE=https://files.pythonhosted.org/packages/source/b/botocore/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch AS install
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/python . /
COPY --from=stagex/py-flit . /
COPY --from=stagex/py-gpep517 . /
COPY --from=stagex/zlib . /
RUN tar -xzf ${SRC_FILE}
WORKDIR /botocore-${VERSION}
RUN <<-EOF
set -eu
sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"
mkdir -p "/rootfs/${sitedir}"
cp -a botocore "/rootfs/$sitedir"
find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
EOF
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /