2022-10-27 12:25:32 +00:00
|
|
|
FROM docker.io/library/python:3.10-slim as base
|
2022-06-08 21:22:43 +00:00
|
|
|
|
2022-10-27 12:25:32 +00:00
|
|
|
# Configure piwheels repo to use pre-compiled numpy wheels for arm
|
|
|
|
RUN echo -n "[global]\nextra-index-url=https://www.piwheels.org/simple\n" >> /etc/pip.conf
|
2022-06-08 21:22:43 +00:00
|
|
|
|
|
|
|
|
2022-10-27 12:25:32 +00:00
|
|
|
#################
|
|
|
|
FROM base as builder
|
2022-06-08 21:22:43 +00:00
|
|
|
|
2022-10-27 12:25:32 +00:00
|
|
|
RUN apt-get update && apt-get install -y git && \
|
|
|
|
pip3 install poetry==1.2.0 && \
|
|
|
|
poetry self add "poetry-dynamic-versioning[plugin]"
|
|
|
|
ADD . .
|
2022-06-08 21:22:43 +00:00
|
|
|
|
2022-10-27 12:25:32 +00:00
|
|
|
RUN poetry build
|
2022-06-08 21:22:43 +00:00
|
|
|
|
2022-10-27 12:25:32 +00:00
|
|
|
#################
|
|
|
|
FROM base
|
|
|
|
|
|
|
|
COPY --from=builder dist/*.whl /tmp/
|
|
|
|
RUN pip3 install /tmp/*whl
|
|
|
|
|
|
|
|
WORKDIR /tmp
|
|
|
|
USER 1234
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/train"]
|