-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
52 lines (41 loc) · 1.21 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
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 "prod" {
targets = ["NAME-service"]
}
group "default" {
targets = ["NAME-service-base"]
}
# ----------------------------------------------------------------------------------------------------------------------
target "_platforms" {
platforms = ["linux/amd64", "linux/arm64"]
}
target "NAME-service-base" {
context = "."
tags = tag("NAME-service", "", "")
dockerfile = "Dockerfile"
}
target "NAME-service" {
inherits = ["_platforms", "NAME-service-base"]
}