forked from openclarity/vmclarity
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-bake.hcl
155 lines (139 loc) · 4.47 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Documentation available at: https://docs.docker.com/build/bake/
# Docker build args
variable "DOCKER_REGISTRY" {default = "ghcr.io/openclarity"}
variable "DOCKER_TAG" {default = "latest"}
variable "SUFFIX" {default = ""}
# Golang build args
variable "VERSION" {default = null}
variable "BUILD_TIMESTAMP" {default = null}
variable "COMMIT_HASH" {default = null}
variable "VMCLARITY_TOOLS_BASE" {default = null}
variable "BUILD_OPTS" {default = null}
function "get_tag" {
params = [name]
result = ["${DOCKER_REGISTRY}/${name}${SUFFIX}:${DOCKER_TAG}"]
}
group "default" {
targets = [
"vmclarity-apiserver",
"vmclarity-cli",
"vmclarity-cr-discovery-server",
"vmclarity-orchestrator",
"vmclarity-ui",
"vmclarity-ui-backend",
"vmclarity-plugin-kics",
]
}
group "vmclarity-scanner-plugins" {
targets = [
"vmclarity-plugin-kics",
"vmclarity-plugin-example-go",
"vmclarity-plugin-example-python"
]
}
target "_common" {
labels = {
"org.opencontainers.image.url" = "https://github.com/openclarity/vmclarity"
"org.opencontainers.image.licenses" = "Apache-2.0"
}
output = ["type=image"]
}
target "_common_args_for_go" {
args = {
VERSION = "${VERSION}"
BUILD_TIMESTAMP = "${BUILD_TIMESTAMP}"
COMMIT_HASH = "${COMMIT_HASH}"
BUILD_OPTS = "${BUILD_OPTS}"
}
}
target "vmclarity-apiserver" {
context = "."
dockerfile = "Dockerfile.apiserver"
tags = get_tag("${target.vmclarity-apiserver.name}")
inherits = ["_common", "_common_args_for_go"]
labels = {
"org.opencontainers.image.title" = "VMClarity API Server"
"org.opencontainers.image.description" = "The VMClarity API for managing all objects in the VMClarity system."
}
}
target "vmclarity-cli" {
context = "."
dockerfile = "Dockerfile.cli"
tags = get_tag("${target.vmclarity-cli.name}")
inherits = ["_common", "_common_args_for_go"]
args = {
VMCLARITY_TOOLS_BASE = "${VMCLARITY_TOOLS_BASE}"
}
labels = {
"org.opencontainers.image.title" = "VMClarity CLI"
"org.opencontainers.image.description" = "The VMClarity CLI for managing all objects in the VMClarity system."
}
}
target "vmclarity-cr-discovery-server" {
context = "."
dockerfile = "Dockerfile.cr-discovery-server"
tags = get_tag("${target.vmclarity-cr-discovery-server.name}")
inherits = ["_common", "_common_args_for_go"]
labels = {
"org.opencontainers.image.title" = "Container Runtime Discovery Server"
"org.opencontainers.image.description" = "Container Runtime Discovery Server for VMClarity."
}
}
target "vmclarity-orchestrator" {
context = "."
dockerfile = "Dockerfile.orchestrator"
tags = get_tag("${target.vmclarity-orchestrator.name}")
inherits = ["_common", "_common_args_for_go"]
labels = {
"org.opencontainers.image.title" = "VMClarity Orchestrator"
"org.opencontainers.image.description" = "Orchestrates and manages the life cycle of VMClarity scan configs, scans and asset scans."
}
}
target "vmclarity-ui" {
context = "."
dockerfile = "Dockerfile.ui"
tags = get_tag("${target.vmclarity-ui.name}")
inherits = ["_common"]
labels = {
"org.opencontainers.image.title" = "VMClarity UI"
"org.opencontainers.image.description" = "A server serving the UI static files."
}
}
target "vmclarity-ui-backend" {
context = "."
dockerfile = "Dockerfile.uibackend"
tags = get_tag("${target.vmclarity-ui-backend.name}")
inherits = ["_common", "_common_args_for_go"]
labels = {
"org.opencontainers.image.title" = "VMClarity UI Backend"
"org.opencontainers.image.description" = "A separate backend API which offloads some processing from the browser to the infrastructure to process and filter data closer to the source."
}
}
target "vmclarity-plugin-kics" {
context = "."
dockerfile = "./plugins/store/kics/Dockerfile"
tags = get_tag("${target.vmclarity-plugin-kics.name}")
inherits = ["_common", "_common_args_for_go"]
labels = {
"org.opencontainers.image.title" = "VMClarity KICS Scanner"
"org.opencontainers.image.description" = ""
}
}
target "vmclarity-plugin-example-go" {
context = "."
dockerfile = "./plugins/sdk/go/example/Dockerfile"
tags = get_tag("${target.vmclarity-plugin-example-go.name}")
labels = {
"org.opencontainers.image.title" = "VMClarity Scanner Go Example"
"org.opencontainers.image.description" = ""
}
}
target "vmclarity-plugin-example-python" {
context = "."
dockerfile = "./plugins/sdk/python/example/Dockerfile"
tags = get_tag("${target.vmclarity-plugin-example-python.name}")
labels = {
"org.opencontainers.image.title" = "VMClarity Scanner Python Example"
"org.opencontainers.image.description" = ""
}
}