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:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
DOCKER_DAEMON_TIMEOUT: 300
# DOCKER_HOST: "unix:///var/run/docker.sock"
DOCKER_HOST: "tcp://localhost:2375"
# DOCKER_HOST: "unix:///var/run/docker.sock"
DOCKER_OPTS: "--data-root=/mnt/volume/docker-data"
DOCKER_MEMORY: "4g"
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:
stage: build
image: docker:dind
services:
- name: docker:dind
......@@ -35,6 +46,7 @@ build:
- docker build -t $DOCKER_REPO:flask .
containerize:
stage: containerize
image: docker:dind
services:
- docker:dind
......@@ -44,6 +56,7 @@ containerize:
- docker push $DOCKER_REPO:flask
deploy:
stage: deploy
image: docker:dind
services:
- docker:dind
......@@ -61,4 +74,6 @@ deploy:
sudo docker rm flask-container || true
sudo docker pull $DOCKER_REPO:flask
sudo docker run --name flask-container -d -p 5000:5000 $DOCKER_REPO:flask
"
\ No newline at end of file
"
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