buildx/docs/guides/cache/azblob.md
Justin Chadwell 04b56c7331 docs: add cache storage backend docs
This fleshes out the documentation to include information along with
examples and detailed use cases for the cache backends. The general
format and style follows from the style of the build driver docs.

Eventually, these docs will be included on docs.docker.com along with
the rest of the build docs.

Signed-off-by: Justin Chadwell <me@jedevc.com>
2022-09-22 10:51:16 +01:00

2.4 KiB

Azure Blob Storage cache storage

Warning

The azblob cache is currently unreleased. You can use it today, by using the moby/buildkit:master image in your Buildx driver.

The azblob cache store uploads your resulting build cache to Azure's blob storage service.

Note

The azblob cache storage backend requires using a different driver than the default docker driver - see more information on selecting a driver here. To create a new docker-container driver (which can act as a simple drop-in replacement):

docker buildx create --use --driver=docker-container

To import and export your cache using the azblob storage backend we use the --cache-to and --cache-from flags and point it to our desired blob using the required account_url and name parameters:

$ docker buildx build --push -t <user>/<image> \
  --cache-to type=azblob,account_url=https://myaccount.blob.core.windows.net,name=my_image \
  --cache-from type=azblob,account_url=https://myaccount.blob.core.windows.net,name=my_image

Authentication

To authenticate to Azure to read from and write to the cache, the following parameters are required:

While these can be manually provided, if left unspecified, then the credentials for Azure will be pulled from the BuildKit server's environment following the environment variables scheme for the Azure Go SDK.

Warning

These environment variables must be specified on the BuildKit server, not the buildx client.

Cache options

The azblob cache has lots of parameters to adjust its behavior.

Cache mode

See Registry - Cache mode for more information.

Further reading

For an introduction to caching see Optimizing builds with cache management.

For more information on the azblob cache backend, see the BuildKit README.