-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-bake.hcl
59 lines (50 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// 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 = "ghcr.io/agntcy"}
variable "IMAGE_TAG" {default = "v0.1.0-rc"}
variable "EXTRA_LDFLAGS" {default = ""}
function "get_tag" {
params = [tags, name]
result = coalescelist(tags, ["${IMAGE_REPO}/${name}:${IMAGE_TAG}"])
}
group "default" {
targets = [
"dir-apiserver",
"dir-ctl",
]
}
target "_common" {
output = [
"type=image",
]
platforms = [
"linux/arm64",
"linux/amd64",
]
args = {
EXTRA_LDFLAGS = "${EXTRA_LDFLAGS}"
}
}
target "docker-metadata-action" {
tags = []
}
target "dir-apiserver" {
context = "."
dockerfile = "./server/Dockerfile"
inherits = [
"_common",
"docker-metadata-action",
]
tags = get_tag(target.docker-metadata-action.tags, "${target.dir-apiserver.name}")
}
target "dir-ctl" {
context = "."
dockerfile = "./cli/Dockerfile"
inherits = [
"_common",
"docker-metadata-action",
]
tags = get_tag(target.docker-metadata-action.tags, "${target.dir-ctl.name}")
}