forked from coreruleset/modsecurity-crs-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
99 lines (85 loc) · 2.19 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
# docker-bake.hcl
variable "crs-version" {
default = "3.3.5"
}
variable "REPO" {
default = "owasp/modsecurity-crs"
}
function "major" {
params = [version]
result = split(".", version)[0]
}
function "minor" {
params = [version]
result = join(".", slice(split(".", version),0,2))
}
function "patch" {
params = [version]
result = join(".", slice(split(".", version),0,3))
}
function "tag" {
params = [tag]
result = ["${REPO}:${tag}"]
}
function "vtag" {
params = [semver, variant]
result = concat(
tag("${major(semver)}${variant}-${formatdate("YYYYMMDDHHMM", timestamp())}"),
tag("${minor(semver)}${variant}-${formatdate("YYYYMMDDHHMM", timestamp())}"),
tag("${patch(semver)}${variant}-${formatdate("YYYYMMDDHHMM", timestamp())}")
)
}
group "default" {
targets = [
"apache",
"apache-alpine",
"nginx",
"nginx-alpine",
"openresty-alpine-fat"
]
}
target "docker-metadata-action" {}
target "platforms-base" {
inherits = ["docker-metadata-action"]
context="."
platforms = ["linux/amd64", "linux/arm64/v8", "linux/arm/v7", "linux/i386"]
args = {
CRS_RELEASE = "${crs-version}"
}
}
target "apache" {
inherits = ["platforms-base"]
dockerfile="apache/Dockerfile"
tags = concat(tag("apache"),
vtag("${crs-version}", "-apache")
)
}
target "apache-alpine" {
inherits = ["platforms-base"]
dockerfile="apache/Dockerfile-alpine"
tags = concat(tag("apache-alpine"),
vtag("${crs-version}", "-apache-alpine")
)
}
target "nginx" {
inherits = ["platforms-base"]
dockerfile="nginx/Dockerfile"
tags = concat(tag("nginx"),
vtag("${crs-version}", "-nginx")
)
}
target "nginx-alpine" {
inherits = ["platforms-base"]
dockerfile="nginx/Dockerfile-alpine"
tags = concat(tag("nginx-alpine"),
vtag("${crs-version}", "-nginx-alpine")
)
}
target "openresty-alpine-fat" {
inherits = ["platforms-base"]
platforms = ["linux/amd64", "linux/arm64/v8"]
dockerfile="openresty/Dockerfile-alpine"
tags = concat(tag("openresty-alpine-fat"),
vtag("${crs-version}", "-openresty-alpine-fat")
)
}