Azure Blob 存储缓存
目录
实验性
这是一个实验性功能。接口和行为不稳定,可能在未来的版本中发生变化。
azblob 缓存存储将您生成的构建缓存上传到
Azure的blob存储服务.
默认的docker驱动程序不支持此缓存存储后端。
要使用此功能,请使用不同的驱动程序创建一个新的构建器。有关更多信息,请参阅
构建驱动程序。
概要
$ docker buildx build --push -t <registry>/<image> \
--cache-to type=azblob,name=<cache-image>[,parameters...] \
--cache-from type=azblob,name=<cache-image>[,parameters...] .
下表描述了可以传递给--cache-to和--cache-from的可用CSV参数。
| Name | Option | Type | Default | Description |
|---|---|---|---|---|
name | cache-to,cache-from | String | Required. The name of the cache image. | |
account_url | cache-to,cache-from | String | Base URL of the storage account. | |
secret_access_key | cache-to,cache-from | String | Blob storage account key, see authentication. | |
mode | cache-to | min,max | min | Cache layers to export, see cache mode. |
ignore-error | cache-to | Boolean | false | Ignore errors caused by failed cache exports. |
认证
如果未指定secret_access_key,则会根据Azure Go SDK的方案从BuildKit服务器的环境变量中读取。环境变量是从服务器读取的,而不是从Buildx客户端读取的。
进一步阅读
有关缓存的介绍,请参见 Docker 构建缓存。
有关azblob缓存后端的更多信息,请参阅
BuildKit README。