feat(docker): using cache-from can speed up your Docker builds

This commit is contained in:
Bo-Yi Wu 2019-02-22 00:56:48 +08:00
parent 2aee0589c9
commit 6b07a8b27d
2 changed files with 8 additions and 0 deletions

View File

@ -154,6 +154,7 @@ local PipelineBuild(name, os='linux', arch='amd64') = {
tags: os + '-' + arch, tags: os + '-' + arch,
dockerfile: 'docker/Dockerfile.' + os + '.' + arch, dockerfile: 'docker/Dockerfile.' + os + '.' + arch,
repo: 'appleboy/' + name, repo: 'appleboy/' + name,
cache_from: 'appleboy/' + name,
username: { 'from_secret': 'docker_username' }, username: { 'from_secret': 'docker_username' },
password: { 'from_secret': 'docker_password' }, password: { 'from_secret': 'docker_password' },
}, },
@ -171,6 +172,7 @@ local PipelineBuild(name, os='linux', arch='amd64') = {
auto_tag_suffix: os + '-' + arch, auto_tag_suffix: os + '-' + arch,
dockerfile: 'docker/Dockerfile.' + os + '.' + arch, dockerfile: 'docker/Dockerfile.' + os + '.' + arch,
repo: 'appleboy/' + name, repo: 'appleboy/' + name,
cache_from: 'appleboy/' + name,
username: { 'from_secret': 'docker_username' }, username: { 'from_secret': 'docker_username' },
password: { 'from_secret': 'docker_password' }, password: { 'from_secret': 'docker_password' },
}, },

View File

@ -111,6 +111,7 @@ steps:
pull: always pull: always
image: plugins/docker:linux-amd64 image: plugins/docker:linux-amd64
settings: settings:
cache_from: appleboy/drone-telegram
dockerfile: docker/Dockerfile.linux.amd64 dockerfile: docker/Dockerfile.linux.amd64
dry_run: true dry_run: true
password: password:
@ -129,6 +130,7 @@ steps:
settings: settings:
auto_tag: true auto_tag: true
auto_tag_suffix: linux-amd64 auto_tag_suffix: linux-amd64
cache_from: appleboy/drone-telegram
daemon_off: false daemon_off: false
dockerfile: docker/Dockerfile.linux.amd64 dockerfile: docker/Dockerfile.linux.amd64
password: password:
@ -194,6 +196,7 @@ steps:
pull: always pull: always
image: plugins/docker:linux-arm64 image: plugins/docker:linux-arm64
settings: settings:
cache_from: appleboy/drone-telegram
dockerfile: docker/Dockerfile.linux.arm64 dockerfile: docker/Dockerfile.linux.arm64
dry_run: true dry_run: true
password: password:
@ -212,6 +215,7 @@ steps:
settings: settings:
auto_tag: true auto_tag: true
auto_tag_suffix: linux-arm64 auto_tag_suffix: linux-arm64
cache_from: appleboy/drone-telegram
daemon_off: false daemon_off: false
dockerfile: docker/Dockerfile.linux.arm64 dockerfile: docker/Dockerfile.linux.arm64
password: password:
@ -277,6 +281,7 @@ steps:
pull: always pull: always
image: plugins/docker:linux-arm image: plugins/docker:linux-arm
settings: settings:
cache_from: appleboy/drone-telegram
dockerfile: docker/Dockerfile.linux.arm dockerfile: docker/Dockerfile.linux.arm
dry_run: true dry_run: true
password: password:
@ -295,6 +300,7 @@ steps:
settings: settings:
auto_tag: true auto_tag: true
auto_tag_suffix: linux-arm auto_tag_suffix: linux-arm
cache_from: appleboy/drone-telegram
daemon_off: false daemon_off: false
dockerfile: docker/Dockerfile.linux.arm dockerfile: docker/Dockerfile.linux.arm
password: password: