Added support for multistage build cache
This commit is contained in:
31
README.md
31
README.md
@@ -463,6 +463,37 @@ builder:
|
||||
context: ".."
|
||||
```
|
||||
|
||||
### Using multistage builder cache
|
||||
|
||||
Docker multistage build cache can singlehandedly speed up your builds by a lot. Currently MRSK only supports using the GHA cache or the Registry cache:
|
||||
|
||||
```yaml
|
||||
# Using GHA cache
|
||||
builder:
|
||||
cache:
|
||||
type: gha
|
||||
|
||||
# Using Registry cache
|
||||
builder:
|
||||
cache:
|
||||
type: registry
|
||||
|
||||
# Using Registry cache with different cache image
|
||||
builder:
|
||||
cache:
|
||||
type: registry
|
||||
# default image name is <image>-build-cache
|
||||
image: application-cache-image
|
||||
|
||||
# Using Registry cache with additinonal cache-to options
|
||||
builder:
|
||||
cache:
|
||||
type: registry
|
||||
options: mode=max,image-manifest=true,oci-mediatypes=true
|
||||
```
|
||||
|
||||
For further insights into build cache optimization, check out documentation on Docker's official website: https://docs.docker.com/build/cache/.
|
||||
|
||||
### Using build secrets for new images
|
||||
|
||||
Some images need a secret passed in during build time, like a GITHUB_TOKEN, to give access to private gem repositories. This can be done by having the secret in ENV, then referencing it in the builder configuration:
|
||||
|
||||
Reference in New Issue
Block a user