forked from fleetbase/fleetbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
51 lines (43 loc) · 1.16 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
// docker-bake.hcl
variable "REGISTRY" { default = "" }
variable "VERSION" { default = "latest" }
variable "CACHE" { default = "" }
variable "GCP" { default = false }
variable "GITHUB_AUTH_KEY" { default = "" }
group "default" {
targets = ["app", "app-httpd"]
}
target "app" {
name = "app-${tgt}"
// use matrix strategy to build several targets at once
matrix = {
tgt = ["app", "scheduler", "events"]
}
context = "./"
// set the target from matrix
target = tgt
dockerfile = "docker/Dockerfile"
platforms = [
"linux/amd64",
]
tags = notequal("", REGISTRY) ? formatlist(
GCP ? "${REGISTRY}/${tgt}:%s" : "${REGISTRY}:${tgt}-%s",
compact(["latest", VERSION])
) : []
args = {
GITHUB_AUTH_KEY = "${GITHUB_AUTH_KEY}"
}
cache-from = notequal("", CACHE) ? ["${CACHE}"] : []
cache-to = notequal("", CACHE) ? ["${CACHE},mode=max,ignore-error=true"] : []
}
target "app-httpd" {
context = "./"
dockerfile = "docker/httpd/Dockerfile"
platforms = [
"linux/amd64",
]
tags = notequal("", REGISTRY) ? formatlist(
GCP ? "${REGISTRY}/app-httpd:%s" : "${REGISTRY}:app-httpd-%s",
compact(["latest", VERSION])
) : []
}