forked from ml4ai/skema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
78 lines (62 loc) · 1.87 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
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 = ["skema-py", "skema-rs"]
}
group "tr" {
targets = ["skema-text-reading"]
}
group "default" {
targets = ["skema-py-base", "skema-rs-base", "skema-text-reading-base"]
}
# ----------------------------------------------------------------------------------------------------------------------
target "_platforms" {
# Currently skema-rs and skema-text-reading fails to compile on arm64 so we build only for amd at the moment
# platforms = ["linux/amd64", "linux/arm64"]
platforms = ["linux/amd64"]
}
target "skema-py-base" {
context = "."
tags = tag("skema-py", "", "")
dockerfile = "Dockerfile.skema-py"
}
target "skema-rs-base" {
context = "."
tags = tag("skema-rs", "", "")
dockerfile = "Dockerfile.skema-rs"
}
target "skema-text-reading-base" {
context = "./skema/text_reading/scala/webapp/target/docker/stage/"
tags = tag("skema-text-reading", "", "")
dockerfile = "Dockerfile"
}
target "skema-py" {
inherits = ["_platforms", "skema-py-base"]
}
target "skema-rs" {
inherits = ["_platforms", "skema-rs-base"]
}
target "skema-text-reading" {
inherits = ["_platforms", "skema-text-reading-base"]
}