-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
49 lines (47 loc) · 1.09 KB
/
docker-bake.hcl
File metadata and controls
49 lines (47 loc) · 1.09 KB
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
/*
# To build locally use:
GIT_TAG=$(git describe --tags --candidates=0) \
GIT_SHA_TAG=$(git describe --tags) \
LATEST_TAG=$(git describe --tags --abbrev=0 master) \
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) \
docker buildx bake -f docker-bake.hcl --load
*/
variable "IMAGE_NAME" {
default = "docker.io/4teamwork/docxcompose"
}
variable "GIT_TAG" {
default = ""
}
variable "GIT_SHA_TAG" {
default = ""
}
variable "LATEST_TAG" {
default = ""
}
variable "BRANCH_NAME" {
default = ""
}
target "default" {
dockerfile = "./Dockerfile"
context = "."
target = "prod"
tags = [
strlen(GIT_TAG) > 0 ? "${IMAGE_NAME}:${GIT_TAG}": "",
equal(GIT_TAG, LATEST_TAG) ? "${IMAGE_NAME}:latest": "",
equal(GIT_TAG, "") && equal(BRANCH_NAME, "master") ? "${IMAGE_NAME}:edge": "",
notequal(BRANCH_NAME, "master") && strlen(GIT_TAG) < 1 && strlen(GIT_SHA_TAG) > 0 ? "${IMAGE_NAME}:${GIT_SHA_TAG}": "",
]
platforms = [
"linux/amd64",
strlen(GIT_TAG) > 0 ? "linux/arm64" : "",
]
attest = [
{
type = "provenance"
mode = "max"
},
{
type = "sbom"
}
]
}