Commit c40d4842 authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent ee5f4591
Pipeline #10673 failed
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
stages: stages:
- build - build
- deploy
variables: variables:
DOCKER_BUILDKIT: 1 DOCKER_DRIVER: overlay2
BUILDKIT_INLINE_CACHE: 1 DOCKER_TLS_CERTDIR: ""
DOCKER_TMPDIR: /mnt/volume DOCKER_HOST: "unix:///var/run/docker.sock"
build: build:
stage: build stage: build
...@@ -24,22 +25,16 @@ build: ...@@ -24,22 +25,16 @@ build:
services: services:
- name: docker:24-dind - name: docker:24-dind
command: ["--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"] command: ["--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"]
memory: 1g
memory_swap: 2g
before_script: before_script:
- docker ps || echo "Docker Daemon is not responding"
- docker info || cat /var/log/docker.log
- mkdir -p /mnt/volume - mkdir -p /mnt/volume
- mount /dev/vdb /mnt/volume - mount /dev/vdb /mnt/volume || echo "Already mounted"
- export DOCKER_TMPDIR=/mnt/volume - export DOCKER_TMPDIR=/mnt/volume
- docker system prune -a -f - docker system prune -a -f --volumes || true
- docker volume prune -f
- df -h - df -h
- ls -la /mnt/volume
tmpfs: tmpfs:
- /var/lib/docker:rw,noexec,nosuid,size=20g - /var/lib/docker:rw,noexec,nosuid,size=20g
script: script:
- docker build --no-cache --pull --progress=plain -t flask-backend-full -f flask_ml_api/Dockerfile . - docker build --no-cache --progress=plain -t flask-backend-full -f flask_ml_api/Dockerfile .
cache: cache:
key: build-cache key: build-cache
paths: paths:
...@@ -51,5 +46,5 @@ deploy: ...@@ -51,5 +46,5 @@ deploy:
dependencies: dependencies:
- build - build
script: script:
- docker run -d flask-backend - docker run -d flask-backend-full
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