chore: attempt to use S3 as the container cache.
This commit is contained in:
parent
d07f15636b
commit
65999fcf08
2 changed files with 40 additions and 14 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.docker-build-cache
|
53
.drone.yml
53
.drone.yml
|
@ -3,29 +3,36 @@ type: docker
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
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
|
- name: build
|
||||||
image: thegeeklab/drone-docker-buildx:23
|
image: thegeeklab/drone-docker-buildx:23
|
||||||
privileged: true
|
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:
|
settings:
|
||||||
username: james
|
username: james
|
||||||
password:
|
password:
|
||||||
from_secret: REGISTRY_TOKEN
|
from_secret: REGISTRY_TOKEN
|
||||||
registry: code.harton.nz
|
registry: code.harton.nz
|
||||||
repo: code.harton.nz/james/asdf_container
|
repo: code.harton.nz/james/asdf_container
|
||||||
cache_to: code.harton.nz/james/asdf_container:cache
|
cache_from: 'type=local\\,src=.docker-build-cache'
|
||||||
cache_from: code.harton.nz/james/asdf_container:cache
|
cache_to: 'type=local,dest=.docker-build-cache'
|
||||||
provenance: false
|
provenance: false
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
|
@ -33,3 +40,21 @@ steps:
|
||||||
- linux/arm64
|
- linux/arm64
|
||||||
- linux/amd64
|
- 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
|
||||||
|
|
Loading…
Reference in a new issue