From 6b07a8b27db071331ffbaa04ceefc6c934709c8d Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 22 Feb 2019 00:56:48 +0800 Subject: [PATCH] feat(docker): using cache-from can speed up your Docker builds --- .drone.jsonnet | 2 ++ .drone.yml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.drone.jsonnet b/.drone.jsonnet index 0dff67b..f5ec8e1 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -154,6 +154,7 @@ local PipelineBuild(name, os='linux', arch='amd64') = { tags: os + '-' + arch, dockerfile: 'docker/Dockerfile.' + os + '.' + arch, repo: 'appleboy/' + name, + cache_from: 'appleboy/' + name, username: { 'from_secret': 'docker_username' }, password: { 'from_secret': 'docker_password' }, }, @@ -171,6 +172,7 @@ local PipelineBuild(name, os='linux', arch='amd64') = { auto_tag_suffix: os + '-' + arch, dockerfile: 'docker/Dockerfile.' + os + '.' + arch, repo: 'appleboy/' + name, + cache_from: 'appleboy/' + name, username: { 'from_secret': 'docker_username' }, password: { 'from_secret': 'docker_password' }, }, diff --git a/.drone.yml b/.drone.yml index cb81775..6adb2eb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -111,6 +111,7 @@ steps: pull: always image: plugins/docker:linux-amd64 settings: + cache_from: appleboy/drone-telegram dockerfile: docker/Dockerfile.linux.amd64 dry_run: true password: @@ -129,6 +130,7 @@ steps: settings: auto_tag: true auto_tag_suffix: linux-amd64 + cache_from: appleboy/drone-telegram daemon_off: false dockerfile: docker/Dockerfile.linux.amd64 password: @@ -194,6 +196,7 @@ steps: pull: always image: plugins/docker:linux-arm64 settings: + cache_from: appleboy/drone-telegram dockerfile: docker/Dockerfile.linux.arm64 dry_run: true password: @@ -212,6 +215,7 @@ steps: settings: auto_tag: true auto_tag_suffix: linux-arm64 + cache_from: appleboy/drone-telegram daemon_off: false dockerfile: docker/Dockerfile.linux.arm64 password: @@ -277,6 +281,7 @@ steps: pull: always image: plugins/docker:linux-arm settings: + cache_from: appleboy/drone-telegram dockerfile: docker/Dockerfile.linux.arm dry_run: true password: @@ -295,6 +300,7 @@ steps: settings: auto_tag: true auto_tag_suffix: linux-arm + cache_from: appleboy/drone-telegram daemon_off: false dockerfile: docker/Dockerfile.linux.arm password: