|
|
@ -8,6 +8,14 @@ and your cache output. This means that if you're using a particularly complex
|
|
|
|
build flow, or not exporting your images directly to a registry, then you may
|
|
|
|
build flow, or not exporting your images directly to a registry, then you may
|
|
|
|
want to consider the [registry](./registry.md) cache.
|
|
|
|
want to consider the [registry](./registry.md) cache.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Synopsis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
|
|
|
$ docker buildx build . --push -t <registry>/<image> \
|
|
|
|
|
|
|
|
--cache-to type=inline \
|
|
|
|
|
|
|
|
--cache-from type=registry,ref=<registry>/image
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
To export cache using `inline` storage, pass `type=inline` to the `--cache-to`
|
|
|
|
To export cache using `inline` storage, pass `type=inline` to the `--cache-to`
|
|
|
|
option:
|
|
|
|
option:
|
|
|
|
|
|
|
|
|
|
|
@ -30,15 +38,6 @@ the specified registry:
|
|
|
|
$ docker buildx build . --push -t <registry>/<image> --cache-from type=registry,ref=<registry>/<image>
|
|
|
|
$ docker buildx build . --push -t <registry>/<image> --cache-from type=registry,ref=<registry>/<image>
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Most of the time, you'll want to have each build both import and export cache
|
|
|
|
|
|
|
|
from the cache store. To do this, specify both `--cache-to` and `--cache-from`:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
|
|
|
$ docker buildx build . --push -t <registry>/<image> \
|
|
|
|
|
|
|
|
--cache-to type=inline \
|
|
|
|
|
|
|
|
--cache-from type=registry,ref=<registry>/<image>
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Further reading
|
|
|
|
## Further reading
|
|
|
|
|
|
|
|
|
|
|
|
For an introduction to caching see
|
|
|
|
For an introduction to caching see
|
|
|
|