-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
55 lines (46 loc) · 1.06 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
variable "DOCKER_REGISTRY" {
default = "docker.uncharted.software"
}
variable "DOCKER_ORG" {
default = "worldmodeler"
}
variable "VERSION" {
default = "local"
}
# ---------------------------------
function "tag" {
params = [image_name, prefix, suffix]
result = [ "${DOCKER_REGISTRY}/${DOCKER_ORG}/${image_name}:${check_prefix(prefix)}${VERSION}${check_suffix(suffix)}" ]
}
function "check_prefix" {
params = [tag]
result = notequal("",tag) ? "${tag}-": ""
}
function "check_suffix" {
params = [tag]
result = notequal("",tag) ? "-${tag}": ""
}
# ---------------------------------
group "causemos" {
targets = ["causemos"]
}
group "ci" {
targets = ["causemos-ci"]
}
# ---------------------------------
target "_platforms" {
platforms = ["linux/amd64", "linux/arm64"]
}
target "causemos" {
context = "."
tags = tag("causemos", "", "")
dockerfile = "Dockerfile"
}
target "causemos-ci-base" {
context = "."
tags = tag("causemos-ci", "", "")
dockerfile = "./ci/Dockerfile"
}
target "causemos-ci" {
inherits = ["_platforms", "causemos-ci-base"]
}