forked from agntcy/slim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
85 lines (72 loc) · 1.61 KB
/
docker-bake.hcl
File metadata and controls
85 lines (72 loc) · 1.61 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
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
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
# Documentation available at: https://docs.docker.com/build/bake/
# Docker build args
variable "IMAGE_REPO" { default = "" }
variable "IMAGE_TAG" { default = "latest" }
function "get_tag" {
params = [tags, name]
// Check if IMAGE_REPO ends with name to avoid repetition
result = [for tag in coalescelist(tags, [IMAGE_TAG]):
can(regex("${name}$", IMAGE_REPO)) ?
"${IMAGE_REPO}:${tag}" :
"${IMAGE_REPO}/${name}:${tag}"
]
}
group "default" {
targets = [
"slim",
]
}
group "data-plane" {
targets = [
"slim",
]
}
group "control-plane" {
targets = [
"control-plane",
]
}
target "_common" {
output = [
"type=image",
]
platforms = [
"linux/arm64",
"linux/amd64",
]
}
target "docker-metadata-action" {
tags = []
}
target "slim" {
context = "."
dockerfile = "./data-plane/Dockerfile"
target = "slim-release"
inherits = [
"_common",
"docker-metadata-action",
]
tags = get_tag(target.docker-metadata-action.tags, "${target.slim.name}")
}
target "slim-debug" {
context = "."
dockerfile = "./data-plane/Dockerfile"
target = "slim-debug"
inherits = [
"_common",
"docker-metadata-action",
]
tags = get_tag(target.docker-metadata-action.tags, "${target.slim-debug.name}")
}
target "control-plane" {
context = "."
dockerfile = "./control-plane/Dockerfile"
target = "control-plane"
inherits = [
"_common",
"docker-metadata-action",
]
tags = get_tag(target.docker-metadata-action.tags, "${target.control-plane.name}")
}