-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-bake.hcl
71 lines (64 loc) · 1.45 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
group "default" {
targets = [
"ldap",
"ldap-cron",
]
}
variable "IMAGE_NAME" {
default = "ldap"
}
variable "TAG_NAME" {
default = ""
}
variable "REGISTRY" {
default = "docker.io"
}
variable "GIT_COMMIT_REV" {
default = ""
}
variable "GIT_SCM_URL" {
default = ""
}
variable "BUILD_DATE" {
default = ""
}
variable "SCM_URI" {
default = ""
}
variable "GIT_TREE_STATE" {
default = ""
}
target "ldap" {
dockerfile = "Dockerfile"
context = "."
target = "ldap"
platforms = ["linux/amd64", "linux/arm64"]
tags = [
"${REGISTRY}/${IMAGE_NAME}:latest",
notequal("", TAG_NAME) ? "${REGISTRY}/${IMAGE_NAME}:${TAG_NAME}" : ""
]
args = {
GIT_COMMIT_REV="${GIT_COMMIT_REV}",
GIT_SCM_URL="${GIT_SCM_URL}",
BUILD_DATE="${BUILD_DATE}",
}
labels = {
"org.opencontainers.image.source"="${GIT_SCM_URL}",
"org.label-schema.vcs-url"="${GIT_SCM_URL}",
"org.opencontainers.image.url"="${SCM_URI}",
"org.label-schema.url"="${SCM_URI}",
"org.opencontainers.image.revision"="${GIT_COMMIT_REV}",
"org.label-schema.vcs-ref"="${GIT_COMMIT_REV}",
"org.opencontainers.image.created"="${BUILD_DATE}",
"org.label-schema.build-date"="${BUILD_DATE}",
"io.jenkins-tools.tree.state"="${GIT_TREE_STATE}"
}
}
target "ldap-cron" {
inherits = ["ldap"]
target = "ldap-cron"
tags = [
"${REGISTRY}/${IMAGE_NAME}:cron-latest",
notequal("", TAG_NAME) ? "${REGISTRY}/${IMAGE_NAME}:cron-${TAG_NAME}" : ""
]
}