Commit 135ce25e authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent d49e35a1
No related merge requests found
Pipeline #10736 failed
Showing with 19 additions and 6 deletions
+19 -6
......@@ -26,7 +26,13 @@ variables:
before_script:
- mkdir -p ~/.docker
- echo $DOCKER_CONFIG_JSON | base64 -d > ~/.docker/config.json
# - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker system prune -a -f --volumes || true
- docker container prune -f || true
- docker network prune -f || true
- docker image prune -a -f || true
- docker builder prune -f || true
-
after_script:
- docker system prune -a -f --volumes || true
- docker container prune -f || true
- docker network prune -f || true
......@@ -35,7 +41,8 @@ before_script:
build:
stage: build
image: docker:dind
image: docker:latest
# image: docker:dind
services:
- name: docker:dind
command: ["--host=fd://", "--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"]
......@@ -51,7 +58,8 @@ build:
deploy:
stage: deploy
image: docker:dind
image: docker:latest
# image: docker:dind
services:
- name: docker:dind
command: ["--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"]
......
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime as build
#FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime as build
FROM pytorch/pytorch:1.10.0-cuda11.7-cudnn8-runtime as build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential python3-venv && \
......@@ -8,6 +9,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN python3 -m venv /opt/myenv
ENV PATH="/opt/myenv/bin:$PATH"
WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir Flask && \
pip install --no-cache-dir matplotlib && \
pip install --no-cache-dir scikit-learn && \
......@@ -16,9 +20,10 @@ RUN pip install --no-cache-dir Flask && \
pip install --no-cache-dir sentence_transformers && \
pip install --no-cache-dir --upgrade setuptools wheel
RUN docker system prune -a --volumes
RUN rm -rf /root/.cache/pip
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
FROM pytorch/pytorch:1.10.0-cuda11.7-cudnn8-runtime
COPY --from=build /opt/myenv /opt/myenv
ENV PATH="/opt/myenv/bin:$PATH"
......
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