-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-bake.hcl
45 lines (38 loc) · 936 Bytes
/
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
variable "DOCKER_REGISTRY" {
default = "ghcr.io"
}
variable "DOCKER_ORG" {
default = "darpa-askem"
}
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 "documentation" {
targets = ["terarium-docs"]
}
# ---------------------------------
target "_platforms" {
platforms = ["linux/amd64", "linux/arm64"]
}
target "terarium-docs-base" {
context = "."
tags = tag("terarium-docs", "", "")
dockerfile = "./Dockerfile"
}
target "terarium-docs" {
inherits = ["_platforms", "terarium-docs-base"]
}