-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-bake.hcl
103 lines (88 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# docker-bake.hcl
variable "VERSION" {
}
variable "PYTHON_VERSION" {
}
variable "PGSQL_VERSION" {
}
variable "RMQ_VERSION" {
}
variable "AIIDA_VERSION" {
}
variable "AIIDALAB_VERSION" {
}
variable "AIIDALAB_HOME_VERSION" {
}
variable "JUPYTER_BASE_IMAGE" {
default = "jupyter/minimal-notebook:python-${PYTHON_VERSION}"
}
variable "ORGANIZATION" {
default = "aiidalab"
}
variable "REGISTRY" {
}
variable "PLATFORMS" {
default = ["linux/amd64"]
}
variable "TARGETS" {
default = ["base", "base-with-services", "lab", "full-stack"]
}
function "tags" {
params = [image]
result = [
"${REGISTRY}${ORGANIZATION}/${image}${VERSION}",
]
}
# Get a Python version string without the patch version (e.g. "3.9.13" -> "3.9")
# Used to construct paths to Python site-packages folder.
function "get_python_minor_version" {
params = [python_version]
result = join(".", slice(split(".", "${python_version}"), 0, 2))
}
group "default" {
targets = "${TARGETS}"
}
target "base" {
tags = tags("base")
context = "stack/base"
platforms = "${PLATFORMS}"
args = {
"BASE" = "${JUPYTER_BASE_IMAGE}"
"AIIDA_VERSION" = "${AIIDA_VERSION}"
}
}
target "base-with-services" {
tags = tags("base-with-services")
context = "stack/base-with-services"
contexts = {
base = "target:base"
}
platforms = "${PLATFORMS}"
args = {
"AIIDA_VERSION" = "${AIIDA_VERSION}"
"PGSQL_VERSION" = "${PGSQL_VERSION}"
"RMQ_VERSION" = "${RMQ_VERSION}"
}
}
target "lab" {
tags = tags("lab")
context = "stack/lab"
contexts = {
base = "target:base"
}
platforms = "${PLATFORMS}"
args = {
"AIIDALAB_VERSION" = "${AIIDALAB_VERSION}"
"AIIDALAB_HOME_VERSION" = "${AIIDALAB_HOME_VERSION}"
"PYTHON_MINOR_VERSION" = get_python_minor_version("${PYTHON_VERSION}")
}
}
target "full-stack" {
tags = tags("full-stack")
context = "stack/full-stack"
contexts = {
base-with-services = "target:base-with-services"
lab = "target:lab"
}
platforms = "${PLATFORMS}"
}