Commit 7ae450a6 authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent ed62dd73
Pipeline #10766 failed with stages
in 45 seconds
Showing with 0 additions and 7 deletions
+0 -7
# Этап сборки
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime as build FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime as build
# Установка Rust и Cargo
RUN apt-get update && apt-get install -y curl RUN apt-get update && apt-get install -y curl
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /usr/local/bin/rustup-init.sh RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /usr/local/bin/rustup-init.sh
RUN chmod +x /usr/local/bin/rustup-init.sh RUN chmod +x /usr/local/bin/rustup-init.sh
RUN /usr/local/bin/rustup-init.sh -y --default-toolchain none RUN /usr/local/bin/rustup-init.sh -y --default-toolchain none
# Добавление пути к rustup и cargo в переменную окружения PATH
ENV PATH="$PATH:/root/.cargo/bin" ENV PATH="$PATH:/root/.cargo/bin"
# Установка toolchain
RUN /root/.cargo/bin/rustup toolchain install stable --profile minimal --no-self-update RUN /root/.cargo/bin/rustup toolchain install stable --profile minimal --no-self-update
# Проверка установки Rust и Cargo
RUN /root/.cargo/bin/rustup --version RUN /root/.cargo/bin/rustup --version
RUN /root/.cargo/bin/cargo --version RUN /root/.cargo/bin/cargo --version
...@@ -28,12 +23,10 @@ ENV PATH="/opt/myenv/bin:$PATH" ...@@ -28,12 +23,10 @@ ENV PATH="/opt/myenv/bin:$PATH"
WORKDIR /app WORKDIR /app
COPY . /app COPY . /app
# Установка пакетов Python
RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas sentence_transformers && \ RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas sentence_transformers && \
pip install --no-cache-dir --upgrade setuptools wheel && \ pip install --no-cache-dir --upgrade setuptools wheel && \
rm -rf /root/.cache/pip rm -rf /root/.cache/pip
# Этап финального образа
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
COPY --from=build /opt/myenv /opt/myenv COPY --from=build /opt/myenv /opt/myenv
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment