30 lines
911 B
Text
30 lines
911 B
Text
|
FROM scratch as base
|
||
|
ENV VERSION=2024.2.2
|
||
|
ENV SRC_HASH=0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f
|
||
|
ENV SRC_FILE=certifi-${VERSION}.tar.gz
|
||
|
ENV SRC_SITE=https://files.pythonhosted.org/packages/source/c/certifi/${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 certifi-${VERSION}
|
||
|
RUN <<-EOF
|
||
|
set -eu
|
||
|
sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"
|
||
|
mkdir -p "/rootfs/${sitedir}"
|
||
|
cp -a certifi "/rootfs/$sitedir"
|
||
|
find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
|
||
|
find /rootfs -exec touch -hcd "@0" "{}" +
|
||
|
EOF
|
||
|
|
||
|
FROM stagex/filesystem as package
|
||
|
COPY --from=install /rootfs/. /
|