s3cmd-container/Containerfile

41 lines
974 B
Plaintext
Raw Normal View History

2024-05-02 21:39:01 +00:00
ARG PYTHON_VERSION=3.12
FROM docker.io/library/python:${PYTHON_VERSION} AS build
ARG POETRY_VERSION=1.8.1
RUN python -m pip install pip --upgrade
RUN curl -sSL -o /install-poetry.py https://install.python-poetry.org
RUN python /install-poetry.py --yes --version ${POETRY_VERSION}
ADD . /build
WORKDIR /build
RUN /root/.local/bin/poetry self add poetry-plugin-export
RUN /root/.local/bin/poetry export \
--format requirements.txt \
--output /build/requirements.txt \
--without-hashes
RUN python -m pip wheel \
--wheel-dir /build/wheels \
--requirement /build/requirements.txt \
--disable-pip-version-check \
--no-cache-dir
FROM docker.io/library/python:${PYTHON_VERSION}-slim AS final
COPY --from=build /build/wheels /tmp/wheels
RUN python -m pip install /tmp/wheels/*.whl \
--upgrade \
--pre \
--no-index \
--no-cache-dir \
--find-links /tmp/wheels \
--disable-pip-version-check
RUN rm -rf /tmp/wheels
ENTRYPOINT ["s3cmd"]
CMD ["--help"]