2024-03-28 00:38:03 +00:00
|
|
|
FROM scratch as base
|
|
|
|
ENV VERSION=2.15.31
|
|
|
|
ENV SRC_HASH=6507f894a30036ad002b54e12f49959c592c8507765405c52cf7b4ba4dc2509d
|
|
|
|
ENV SRC_FILE=${VERSION}.tar.gz
|
|
|
|
ENV SRC_SITE=https://github.com/aws/aws-cli/archive/refs/tags/${VERSION}/${SRC_FILE}
|
|
|
|
|
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
|
|
|
FROM fetch as build
|
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/zlib . /
|
|
|
|
COPY --from=stagex/sqlite3 . /
|
|
|
|
COPY --from=stagex/python . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/libunwind . /
|
|
|
|
COPY --from=stagex/libffi . /
|
|
|
|
COPY --from=stagex/openssl . /
|
|
|
|
COPY --from=stagex/py-flit . /
|
|
|
|
COPY --from=stagex/py-gpep517 . /
|
|
|
|
COPY --from=stagex/py-installer . /
|
|
|
|
COPY --from=stagex/py-distro . /
|
|
|
|
COPY --from=stagex/py-jmespath . /
|
|
|
|
COPY --from=stagex/py-dateutil . /
|
|
|
|
COPY --from=stagex/py-urllib3 . /
|
|
|
|
COPY --from=stagex/py-cffi . /
|
|
|
|
COPY --from=stagex/py-six . /
|
|
|
|
COPY --from=stagex/py-botocore . /
|
|
|
|
COPY --from=stagex/py-awscrt . /
|
|
|
|
COPY --from=stagex/py-certifi . /
|
|
|
|
COPY --from=stagex/py-cryptography . /
|
|
|
|
COPY --from=stagex/py-colorama . /
|
|
|
|
COPY --from=stagex/py-docutils . /
|
|
|
|
COPY --from=stagex/py-wcwidth . /
|
|
|
|
COPY --from=stagex/py-prompt_toolkit . /
|
|
|
|
COPY --from=stagex/py-ruamel.yaml . /
|
|
|
|
RUN tar -xzf ${SRC_FILE}
|
|
|
|
WORKDIR aws-cli-${VERSION}
|
2024-04-11 20:09:20 +00:00
|
|
|
RUN --network=none \
|
2024-03-28 00:38:03 +00:00
|
|
|
gpep517 build-wheel \
|
|
|
|
--wheel-dir .dist \
|
|
|
|
--output-fd 3 3>&1 >&2
|
|
|
|
|
|
|
|
FROM build as install
|
2024-04-11 20:09:20 +00:00
|
|
|
RUN --network=none <<-EOF
|
2024-03-28 00:38:03 +00:00
|
|
|
set -eu
|
|
|
|
python -m installer -d /rootfs .dist/*.whl
|
|
|
|
find /rootfs | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf
|
2024-04-01 04:12:56 +00:00
|
|
|
rm /rootfs/usr/lib/python*/site-packages/awscli-*.dist-info/RECORD
|
2024-03-28 00:38:03 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
FROM stagex/filesystem as package
|
|
|
|
COPY --from=install /rootfs/. /
|