forked from SumoLogic/sumologic-kubernetes-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
87 lines (71 loc) · 1.82 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
variable "IMAGE" {
default = "kubernetes-tools"
}
variable "TAG" {
default = "dev-latest"
}
variable "CACHE_IMAGE" {
default = "sumologic/kubernetes-tools"
}
variable "BUILD_GO_CACHE_TAG" {
default = "go-build-cache"
}
variable "BUILD_RUST_CACHE_TAG" {
default = "rust-build-cache"
}
variable "TOOLS_CACHE_TAG" {
default = "tools-build-cache"
}
target "multiplatform" {
platforms = ["linux/amd64", "linux/arm64"]
output = ["type=image"]
}
target "default" {
dockerfile = "Dockerfile"
tags = ["${IMAGE}:${TAG}"]
cache-from = [
"${CACHE_IMAGE}:${BUILD_GO_CACHE_TAG}",
"${CACHE_IMAGE}:${BUILD_RUST_CACHE_TAG}",
"${CACHE_IMAGE}:${TOOLS_CACHE_TAG}",
]
output = ["type=docker"]
platforms = ["linux/amd64"]
}
target "tools-multiplatform" {
inherits = ["default", "multiplatform"]
}
group "cache" {
targets = ["rust-cache", "go-cache", "tools-cache"]
}
target "rust-cache" {
dockerfile = "Dockerfile"
cache-from = [
"${CACHE_IMAGE}:${BUILD_RUST_CACHE_TAG}",
]
cache-to = ["${CACHE_IMAGE}:${BUILD_RUST_CACHE_TAG}"]
target = "rust-builder"
}
target "go-cache" {
dockerfile = "Dockerfile"
cache-from = [
"${CACHE_IMAGE}:${BUILD_GO_CACHE_TAG}",
]
cache-to = ["${CACHE_IMAGE}:${BUILD_GO_CACHE_TAG}"]
target = "go-builder"
}
target "tools-cache" {
inherits = ["default"]
cache-to = ["${CACHE_IMAGE}:${TOOLS_CACHE_TAG}"]
}
group "cache-multiplatform" {
targets = ["rust-cache-multiplatform", "go-cache-multiplatform", "tools-cache-multiplatform"]
}
target "rust-cache-multiplatform" {
inherits = ["rust-cache", "multiplatform"]
}
target "go-cache-multiplatform" {
inherits = ["go-cache", "multiplatform"]
}
target "tools-cache-multiplatform" {
inherits = ["tools-cache", "multiplatform"]
}