Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KNIGHT
Asyst Moodle Plugin
Commits
ed62dd73
Commit
ed62dd73
authored
Jan 09, 2025
by
Artem Baranovskyi
Browse files
Image build is optimized.
parent
bdb6fce7
Pipeline
#10765
failed with stages
in 46 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
ed62dd73
...
@@ -31,6 +31,8 @@ before_script:
...
@@ -31,6 +31,8 @@ before_script:
-
docker network prune -f ||
true
-
docker network prune -f ||
true
-
docker image prune -a -f ||
true
-
docker image prune -a -f ||
true
-
docker builder prune -f ||
true
-
docker builder prune -f ||
true
-
apt-get update
-
apt-get install -y apt-utils
-
apt-get clean
-
apt-get clean
-
rm -rf /var/lib/apt/lists/*
-
rm -rf /var/lib/apt/lists/*
-
rm -rf /tmp/*
-
rm -rf /tmp/*
...
...
flask_ml_api/Dockerfile
View file @
ed62dd73
# Этап сборки
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
...
@@ -23,10 +28,12 @@ ENV PATH="/opt/myenv/bin:$PATH"
...
@@ -23,10 +28,12 @@ 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment