Use Buildx bake files for better control over the docker images

This commit is contained in:
Quentin Gliech
2021-12-09 23:26:32 +01:00
parent f57559c140
commit 53a274fb53
3 changed files with 57 additions and 7 deletions

35
docker-bake.hcl Normal file
View File

@@ -0,0 +1,35 @@
// Target filled by GitHub Actions, one for the regular tag, one for the debug tag
target "docker-metadata-action" {}
target "docker-metadata-action-debug" {}
target "default" {
dockerfile = "Dockerfile"
context = "./"
}
target "debug" {
inherits = ["default"]
target = "debug"
}
target "release" {
inherits = ["default"]
platforms = ["linux/amd64", "linux/arm64"]
}
// This is what is baked by GitHub Actions
group "gha" { targets = ["gha-regular", "gha-debug"] }
target "gha-base" {
inherits = ["release"]
cache-from = ["type=gha"]
cache-to = ["type=gha,mode=max"]
}
target "gha-regular" {
inherits = ["gha-base", "docker-metadata-action"]
}
target "gha-debug" {
inherits = ["gha-base", "debug", "docker-metadata-action-debug"]
}