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

Image build is optimized.

parent 92c02780
Pipeline #10723 failed with stages
in 53 seconds
...@@ -19,13 +19,24 @@ variables: ...@@ -19,13 +19,24 @@ variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ""
DOCKER_DAEMON_TIMEOUT: 300 DOCKER_DAEMON_TIMEOUT: 300
# DOCKER_HOST: "unix:///var/run/docker.sock"
DOCKER_HOST: "tcp://localhost:2375" DOCKER_HOST: "tcp://localhost:2375"
# DOCKER_HOST: "unix:///var/run/docker.sock"
DOCKER_OPTS: "--data-root=/mnt/volume/docker-data" DOCKER_OPTS: "--data-root=/mnt/volume/docker-data"
DOCKER_MEMORY: "4g" DOCKER_MEMORY: "4g"
DOCKER_CPUS: "2" DOCKER_CPUS: "2"
before_script:
- mkdir -p ~/.docker
- echo $DOCKER_CONFIG_JSON | base64 -d > ~/.docker/config.json
- echo $DOCKER_PW | docker login -u $DOCKER_USER --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
build: build:
stage: build
image: docker:dind image: docker:dind
services: services:
- name: docker:dind - name: docker:dind
...@@ -35,6 +46,7 @@ build: ...@@ -35,6 +46,7 @@ build:
- docker build -t $DOCKER_REPO:flask . - docker build -t $DOCKER_REPO:flask .
containerize: containerize:
stage: containerize
image: docker:dind image: docker:dind
services: services:
- docker:dind - docker:dind
...@@ -44,6 +56,7 @@ containerize: ...@@ -44,6 +56,7 @@ containerize:
- docker push $DOCKER_REPO:flask - docker push $DOCKER_REPO:flask
deploy: deploy:
stage: deploy
image: docker:dind image: docker:dind
services: services:
- docker:dind - docker:dind
...@@ -62,3 +75,5 @@ deploy: ...@@ -62,3 +75,5 @@ deploy:
sudo docker pull $DOCKER_REPO:flask sudo docker pull $DOCKER_REPO:flask
sudo docker run --name flask-container -d -p 5000:5000 $DOCKER_REPO:flask sudo docker run --name flask-container -d -p 5000:5000 $DOCKER_REPO:flask
" "
only:
- master
\ No newline at end of file
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