-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-bake.hcl
74 lines (62 loc) · 1.42 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
variable "GIT_TAG" {
default = "v0.0.0"
}
variable "REPOS" {
# List of repositories to tag
default = [
"ghcr.io/coreruleset/albedo",
]
}
function "version" {
params = [git_tag]
result = regex_replace(git_tag, "^v", "")
}
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 = [for repo in REPOS : "${repo}:${tag}"]
}
group "default" {
targets = [
"default",
]
}
function "major" {
params = [version]
result = split(".", version)[0]
}
function "major_minor" {
params = [version]
result = join(".", slice(split(".", version),0,2))
}
function "major_minor_patch" {
params = [version]
result = join(".", slice(split(".", version),0,3))
}
function "tag" {
params = [tag]
result = [for repo in REPOS : "${repo}:${tag}"]
}
target "default" {
context="."
platforms = ["linux/amd64", "linux/arm64/v8", "linux/arm/v7", "linux/i386"]
labels = {
"org.opencontainers.image.source" = "https://github.com/coreruleset/albedo"
}
tags = concat(
tag(major(version(GIT_TAG))),
tag(major_minor(version(GIT_TAG))),
tag(major_minor_patch(version(GIT_TAG)))
)
}