mirror of https://github.com/docker/docs.git
build: composable bake attributes for cache-to/from, output, secret
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
7fea25488e
commit
12d642b2e2
|
@ -57,15 +57,35 @@ $ docker buildx bake --print
|
|||
"context": ".",
|
||||
"dockerfile": "Dockerfile.webapp",
|
||||
"tags": ["docker.io/username/webapp:latest"],
|
||||
"cache-from": ["docker.io/username/webapp:cache"],
|
||||
"cache-to": ["docker.io/username/webapp:cache"]
|
||||
"cache-from": [
|
||||
{
|
||||
"ref": "docker.io/username/webapp:cache",
|
||||
"type": "registry"
|
||||
}
|
||||
],
|
||||
"cache-to": [
|
||||
{
|
||||
"ref": "docker.io/username/webapp:cache",
|
||||
"type": "registry"
|
||||
}
|
||||
]
|
||||
},
|
||||
"webapp-release": {
|
||||
"context": ".",
|
||||
"dockerfile": "Dockerfile.webapp",
|
||||
"tags": ["docker.io/username/webapp:latest"],
|
||||
"cache-from": ["docker.io/username/webapp:cache"],
|
||||
"cache-to": ["docker.io/username/webapp:cache"],
|
||||
"cache-from": [
|
||||
{
|
||||
"ref": "docker.io/username/webapp:cache",
|
||||
"type": "registry"
|
||||
}
|
||||
],
|
||||
"cache-to": [
|
||||
{
|
||||
"ref": "docker.io/username/webapp:cache",
|
||||
"type": "registry"
|
||||
}
|
||||
],
|
||||
"platforms": ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +200,7 @@ $ docker buildx bake --print
|
|||
{
|
||||
"group": {
|
||||
"default": {
|
||||
"targets": ["aws", "addon"]
|
||||
"targets": ["addon", "aws"]
|
||||
}
|
||||
},
|
||||
"target": {
|
||||
|
@ -192,8 +212,22 @@ $ docker buildx bake --print
|
|||
"CT_TAG": "bar"
|
||||
},
|
||||
"tags": ["ct-addon:foo", "ct-addon:alp"],
|
||||
"cache-from": ["user/app:cache", "type=local,src=path/to/cache"],
|
||||
"cache-to": ["type=local,dest=path/to/cache"],
|
||||
"cache-from": [
|
||||
{
|
||||
"ref": "user/app:cache",
|
||||
"type": "registry"
|
||||
},
|
||||
{
|
||||
"src": "path/to/cache",
|
||||
"type": "local"
|
||||
}
|
||||
],
|
||||
"cache-to": [
|
||||
{
|
||||
"dest": "path/to/cache",
|
||||
"type": "local"
|
||||
}
|
||||
],
|
||||
"platforms": ["linux/amd64", "linux/arm64"],
|
||||
"pull": true
|
||||
},
|
||||
|
@ -205,9 +239,22 @@ $ docker buildx bake --print
|
|||
"CT_TAG": "bar"
|
||||
},
|
||||
"tags": ["ct-fake-aws:bar"],
|
||||
"secret": ["id=mysecret,src=./secret", "id=mysecret2,src=./secret2"],
|
||||
"secret": [
|
||||
{
|
||||
"id": "mysecret",
|
||||
"src": "./secret"
|
||||
},
|
||||
{
|
||||
"id": "mysecret2",
|
||||
"src": "./secret2"
|
||||
}
|
||||
],
|
||||
"platforms": ["linux/arm64"],
|
||||
"output": ["type=docker"],
|
||||
"output": [
|
||||
{
|
||||
"type": "docker"
|
||||
}
|
||||
],
|
||||
"no-cache": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ attributes:
|
|||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "./dockerfiles/lint.Dockerfile"
|
||||
output = ["type=cacheonly"]
|
||||
output = [{ type = "cacheonly" }]
|
||||
}
|
||||
|
||||
target "docs" {
|
||||
|
|
|
@ -157,7 +157,9 @@ docker buildx bake -f bake.hcl -f cwd://local.hcl "https://github.com/crazy-max/
|
|||
},
|
||||
"target": "build",
|
||||
"output": [
|
||||
"type=cacheonly"
|
||||
{
|
||||
"type": "cacheonly"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue