-
-
Notifications
You must be signed in to change notification settings - Fork 271
/
Copy pathdocker-bake.hcl
50 lines (50 loc) · 1.13 KB
/
docker-bake.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
variable "TARGET" {
default = "$TARGET"
}
variable "GHCR_REPO" {
default = "$GHCR_REPO"
}
variable "BUILD_ENV" {
default = "$BUILD_ENV"
}
variable "SUFFIX" {
default = "$SUFFIX"
}
variable "DOCKER_PLATFORM" {
default = "$DOCKER_PLATFORM"
}
target "docker-metadata-action" {}
target "build" {
secret = [
"type=env,id=ACTIONS_CACHE_URL",
"type=env,id=ACTIONS_RUNTIME_TOKEN"
]
args = {
TARGET = "${TARGET}"
BUILD_ENV = equal("", "${BUILD_ENV}") ? null : "${BUILD_ENV}"
}
target = "binaries"
cache-from = [
"type=registry,ref=${GHCR_REPO}-buildcache:${TARGET}"
]
cache-to = [
"type=registry,ref=${GHCR_REPO}-buildcache:${TARGET},mode=max,compression=zstd,compression-level=9,force-compression=true,oci-mediatypes=true,image-manifest=false"
]
context = "./"
dockerfile = "Dockerfile.build"
output = ["./artifact"]
}
target "image" {
inherits = ["build","docker-metadata-action"]
cache-to = [""]
cache-from = [
"type=registry,ref=${GHCR_REPO}-buildcache:${TARGET}"
]
target = equal("", "${SUFFIX}") ? "gnu" : "musl"
platforms = [
"${DOCKER_PLATFORM}"
]
output = [
""
]
}