mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 02:10:35 +02:00
feat: cache dockerfile images through warmer (#2499)
* feat: cache dockerfile images through warmer * Fix logical error in conditional statement * Addressed review feedback 1. Updated help text for the --build-arg flag to indicate it should be used with the dockerfile flag. 2. Updated the documentation to include the optional --build-arg flag. 3. Added unit tests for `ParseDockerfile`, covering scenarios for missing Dockerfile, invalid Dockerfile, single stage Dockerfile, multi-stage Dockerfile and Args Dockerfile --------- Co-authored-by: 连奔驰 <benchi.lian@thoughtworks.com>
This commit is contained in:
@@ -505,9 +505,12 @@ provide a kaniko cache warming image at `gcr.io/kaniko-project/warmer`:
|
||||
|
||||
```shell
|
||||
docker run -v $(pwd):/workspace gcr.io/kaniko-project/warmer:latest --cache-dir=/workspace/cache --image=<image to cache> --image=<another image to cache>
|
||||
docker run -v $(pwd):/workspace gcr.io/kaniko-project/warmer:latest --cache-dir=/workspace/cache --dockerfile=<path to dockerfile>
|
||||
docker run -v $(pwd):/workspace gcr.io/kaniko-project/warmer:latest --cache-dir=/workspace/cache --dockerfile=<path to dockerfile> --build-args version=1.19
|
||||
```
|
||||
|
||||
`--image` can be specified for any number of desired images. This command will
|
||||
`--image` can be specified for any number of desired images. `--dockerfile` can
|
||||
be specified for the path of dockerfile for cache.These command will combined to
|
||||
cache those images by digest in a local directory named `cache`. Once the cache
|
||||
is populated, caching is opted into with the same `--cache=true` flag as above.
|
||||
The location of the local cache is provided via the `--cache-dir` flag,
|
||||
|
||||
Reference in New Issue
Block a user