-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-bake.hcl
147 lines (121 loc) · 3.25 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
variable "IMAGE" {
default = "kubernetes-tools"
}
variable "SUMOLOGIC_MOCK_IMAGE" {
default = "sumologic-mock"
}
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 "BUILD_RUST_SUMOLOGIC_MOCK_CACHE_TAG" {
default = "rust-sumologic-mock-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 "kubectl" {
dockerfile = "Dockerfile.kubectl"
tags = ["${IMAGE}-kubectl:${TAG}"]
output = ["type=docker"]
platforms = ["linux/amd64"]
}
target "kubectl-ubi" {
dockerfile = "Dockerfile.kubectl-ubi"
tags = ["${IMAGE}-kubectl:${TAG}-ubi"]
output = ["type=docker"]
platforms = ["linux/amd64"]
args = {
BUILD_TAG = "${TAG}"
}
}
target "tools-multiplatform" {
inherits = ["default", "multiplatform"]
}
target "kubectl-multiplatform" {
inherits = ["kubectl", "multiplatform"]
}
target "kubectl-ubi-multiplatform" {
inherits = ["kubectl-ubi", "multiplatform"]
}
target "sumologic-mock" {
dockerfile = "Dockerfile.sumologic-mock"
tags = ["${SUMOLOGIC_MOCK_IMAGE}:${TAG}"]
cache-from = [
"${CACHE_IMAGE}:${BUILD_RUST_SUMOLOGIC_MOCK_CACHE_TAG}",
]
output = ["type=docker"]
platforms = ["linux/amd64"]
}
target "sumologic-mock-multiplatform" {
inherits = ["sumologic-mock", "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 "rust-cache-sumologic-mock" {
dockerfile = "Dockerfile.sumologic-mock"
cache-from = [
"${CACHE_IMAGE}:${BUILD_RUST_SUMOLOGIC_MOCK_CACHE_TAG}",
]
cache-to = ["${CACHE_IMAGE}:${BUILD_RUST_SUMOLOGIC_MOCK_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"]
}
target "sumologic-mock-cache-multiplatform" {
inherits = ["rust-cache-sumologic-mock", "multiplatform"]
}