From 3a5e04df12780fe10a0fdcbe0fd23777e1c0622b Mon Sep 17 00:00:00 2001 From: Artem Baranovskyi <artem.baranovsky1980@gmail.com> Date: Mon, 6 Jan 2025 18:41:37 +0200 Subject: [PATCH] Image build is optimized. --- flask_ml_api/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flask_ml_api/Dockerfile b/flask_ml_api/Dockerfile index bdc1fc0..babb246 100755 --- a/flask_ml_api/Dockerfile +++ b/flask_ml_api/Dockerfile @@ -1,5 +1,10 @@ FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime as build +RUN apt-get update && apt-get install -y curl +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh +RUN sh rustup-init.sh -y --default-toolchain none +RUN ~/.cargo/bin/rustup toolchain install stable --profile minimal --no-self-update + RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3-venv && \ apt-get clean && \ @@ -15,7 +20,6 @@ RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas pip install --no-cache-dir --upgrade setuptools wheel && \ rm -rf /root/.cache/pip - FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime COPY --from=build /opt/myenv /opt/myenv -- GitLab