-
Notifications
You must be signed in to change notification settings - Fork 149
/
docker-bake.hcl
43 lines (38 loc) · 1.15 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
variable "IMAGE_VERSION" {
default = ""
}
variable "IMAGE_NAME" {
default = "asciidoctor"
}
group "all" {
targets = [
"asciidoctor-minimal",
"erd-builder",
"asciidoctor"
]
}
target "asciidoctor-minimal" {
dockerfile = "Dockerfile"
context = "."
target = "main-minimal"
platforms = ["linux/amd64", "linux/arm64"]
}
// This image is only used for intermediate steps
target "erd-builder" {
dockerfile = "Dockerfile"
context = "."
target = "erd-builder"
platforms = ["linux/amd64", "linux/arm64"]
}
target "asciidoctor" {
dockerfile = "Dockerfile"
context = "."
target = "main"
platforms = ["linux/amd64", "linux/arm64"]
tags = [
"${IMAGE_NAME}",
notequal("", IMAGE_VERSION) ? "${IMAGE_NAME}:${IMAGE_VERSION}" : "", // Only used when deploying on a tag
notequal("", IMAGE_VERSION) ? "${IMAGE_NAME}:${element(split(".", IMAGE_VERSION), 0)}" : "", // Only used when deploying on a tag (1 digit)
notequal("", IMAGE_VERSION) ? "${IMAGE_NAME}:${element(split(".", IMAGE_VERSION), 0)}.${element(split(".", IMAGE_VERSION), 1)}" : "", // Only used when deploying on a tag (2 digits)
]
}