bake: shared session for local context

With the latest Buildx, BuildKit, and Dockerfile, bake can detect when
multiple targets use the same local context, and deduplicate context
transfer.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson
2024-08-12 13:27:15 +02:00
parent 8e1a75c658
commit dcd1ba4a33
2 changed files with 6 additions and 28 deletions

View File

@@ -14,21 +14,7 @@ group "default" {
targets = ["release"]
}
target "ctx" {
target = "ctx"
context = "."
output = ["type=cacheonly"]
provenance = false
}
target "_common" {
contexts = {
ctx = "target:ctx"
}
}
target "index" {
inherits = ["_common"]
# generate a new local search index
target = "index"
output = ["type=local,dest=static/pagefind"]
@@ -36,7 +22,6 @@ target "index" {
}
target "release" {
inherits = ["_common"]
args = {
HUGO_ENV = HUGO_ENV
DOCS_URL = DOCS_URL
@@ -52,28 +37,24 @@ group "validate" {
target "test" {
target = "test"
inherits = ["_common"]
output = ["type=cacheonly"]
provenance = false
}
target "lint" {
target = "lint"
inherits = ["_common"]
output = ["type=cacheonly"]
provenance = false
}
target "unused-media" {
target = "unused-media"
inherits = ["_common"]
output = ["type=cacheonly"]
provenance = false
}
target "test-go-redirects" {
target = "test-go-redirects"
inherits = ["_common"]
output = ["type=cacheonly"]
provenance = false
}