chore: attempt to use S3 as the container cache.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
James Harton 2023-07-20 08:57:18 +12:00
parent d07f15636b
commit 65999fcf08
Signed by: james
GPG key ID: 90E82DAA13F624F4
2 changed files with 40 additions and 14 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
.docker-build-cache

View file

@ -3,29 +3,36 @@ type: docker
name: default
steps:
- name: retrieve build cache
image: meltwater/drone-cache
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
settings:
restore: true
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
mount: .docker-build-cache
- name: build
image: thegeeklab/drone-docker-buildx:23
privileged: true
when:
ref:
- refs/heads/main
environment:
ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
S3_ENDPOINT:
from_secret: S3_ENDPOINT
CACHE_BUCKET:
from_secret: CACHE_BUCKET
settings:
username: james
password:
from_secret: REGISTRY_TOKEN
registry: code.harton.nz
repo: code.harton.nz/james/asdf_container
cache_to: code.harton.nz/james/asdf_container:cache
cache_from: code.harton.nz/james/asdf_container:cache
cache_from: 'type=local\\,src=.docker-build-cache'
cache_to: 'type=local,dest=.docker-build-cache'
provenance: false
tags:
- latest
@ -33,3 +40,21 @@ steps:
- linux/arm64
- linux/amd64
- name: store build cache
image: meltwater/drone-cache
pull: true
environment:
AWS_ACCESS_KEY_ID:
from_secret: ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: SECRET_ACCESS_KEY
AWS_PLUGIN_PATH_STYLE: true
settings:
rebuild: true
endpoint:
from_secret: S3_ENDPOINT
bucket:
from_secret: CACHE_BUCKET
region: us-east-1
path-style: true
mount: .docker-build-cache