From 9f29e53e63ad12ea22e5bd847a93cefc9ea06066 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 26 Feb 2020 13:18:27 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Travis:=20Cache=20Docker=20builds?= =?UTF-8?q?=20from=20previous=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 9 ++++++++- build | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77076f1..c0dad57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,17 @@ jobs: - stage: Build Docker image script: - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + + # We are using the image my_ocrd_workflow to cache, so pull and tag it + - docker pull $DOCKER_USERNAME/my_ocrd_workflow + - docker tag $DOCKER_USERNAME/my_ocrd_workflow my_ocrd_workflow + - FORCE_DOWNLOAD=y ./build - - docker images + - docker tag my_ocrd_workflow $DOCKER_USERNAME/my_ocrd_workflow + - docker images - docker push $DOCKER_USERNAME/my_ocrd_workflow + - stage: Test script: - docker pull $DOCKER_USERNAME/my_ocrd_workflow diff --git a/build b/build index 5bb124f..08f7c9d 100755 --- a/build +++ b/build @@ -19,4 +19,4 @@ get_from_web() { handle_data -docker build -t my_ocrd_workflow . +docker build --cache-from my_ocrd_workflow -t my_ocrd_workflow .