forked from perfsonar/debian-docker-buildmachines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
64 lines (58 loc) · 1.67 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
// docker bake configuration
// Variables used in this file, docker-compose and Dockerfile
// See following references:
// https://docs.docker.com/engine/reference/commandline/buildx_bake/#hcl-variables-and-functions
// https://github.com/docker/buildx/blob/master/bake/hclparser/stdlib.go
// https://github.com/zclconf/go-cty/tree/main/cty/function/stdlib
variable "REPO" {
default = "perfsonar-patch-snapshot"
}
variable "OSimage" {
default = "debian:buster"
}
variable "OSfamily" {
default = regex_replace("${OSimage}", ":.*", "")
}
variable "useproxy" {
default = "without"
}
variable "proxy" {
default = ""
}
// Defaults
group "default" {
targets = ["single_build", "single_test"]
}
// All the build targets
target "root_build" {
args = {
OSimage = OSimage
REPO = REPO
useproxy = useproxy
proxy = proxy
}
target = "build-image"
output = ["type=cacheonly"]
}
target "single_build" {
inherits = ["root_build"]
output = ["type=docker"]
tags = ["psbuild.${REPO}.${OSimage}"]
}
target "dual_build" {
inherits = ["root_build"]
platforms = ["linux/amd64", "linux/arm64"]
output = ["type=registry"]
tags = ["docker.io/ntw0n/psbuild.${REPO}.${OSfamily}:latest", "docker.io/ntw0n/psbuild.${REPO}.${OSimage}"]
}
target "full_build" {
inherits = ["root_build"]
platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/ppc64le"]
output = ["type=registry"]
tags = ["docker.io/ntw0n/psbuild.${REPO}.${OSfamily}:latest", "docker.io/ntw0n/psbuild.${REPO}.${OSimage}"]
}
target "single_test" {
inherits = ["root_build"]
output = ["type=docker"]
tags = ["pstest.${REPO}.${OSimage}"]
}