This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-bake.hcl
82 lines (65 loc) · 1.99 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
79
80
81
82
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 = ["data-service", "data-service-dev-db", "data-service-storage"]
}
group "default" {
targets = ["data-service-base", "data-service-dev-db-base", "data-service-storage-base"]
}
# ----------------------------------------------------------------------------------------------------------------------
target "_platforms" {
platforms = ["linux/amd64", "linux/arm64"]
}
target "data-service-base" {
context = "."
tags = tag("data-service", "", "")
dockerfile = "docker/Dockerfile"
}
target "data-service-dev-db-base" {
context = "."
tags = tag("data-service-dev-db", "", "")
dockerfile = "docker/Dockerfile-dev-db"
}
target "data-service-storage-base" {
context = "."
tags = tag("data-service-storage", "", "")
dockerfile = "docker/Dockerfile.minio"
}
target "data-service-graphdb-base" {
context = "."
tags = tag("data-service-graphdb", "", "")
dockerfile = "docker/Dockerfile.neo4j"
}
target "data-service" {
inherits = ["_platforms", "data-service-base"]
}
target "data-service-dev-db" {
inherits = ["_platforms", "data-service-dev-db-base"]
}
target "data-service-storage" {
inherits = ["_platforms", "data-service-storage-base"]
}
target "data-service-graphdb" {
inherits = ["_platforms", "data-service-graphdb-base"]
}