-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
121 lines (104 loc) · 2.41 KB
/
docker-bake.hcl
File metadata and controls
121 lines (104 loc) · 2.41 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
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
variable "REPOSITORY" {
default = "claylinux"
}
variable "TAG" {
default = ""
}
variable "PLATFORMS" {
# comma-separated list of platform, e.g. "linux/amd64,linux/arm64", leave empty to use the default platform
default = ""
}
variable "FORMAT" {
# default format for the emulator output
default = "efi"
}
group "lint" {
targets = ["yamllint", "hadolint", "shellcheck"]
}
group "default" {
targets = ["lint", "imager", "alpine-lts", "alpine-stable", "alpine-virt"]
}
group "all" {
targets = ["default", "test", "emulator"]
}
target "shellcheck" {
inherits = ["_lint"]
target = "shellcheck"
}
target "hadolint" {
inherits = ["_lint"]
target = "hadolint"
}
target "yamllint" {
inherits = ["_lint"]
target = "yamllint"
}
target "_lint" {
output = ["type=cacheonly"]
}
target "imager" {
inherits = ["_multiplatform_image"]
target = "imager"
tags = tags("imager")
}
# TODO: we should factor the alpine images
target "alpine-lts" {
inherits = ["_multiplatform_image"]
target = "bootable-alpine"
tags = tags("alpine-lts")
args = {
FLAVOR = "lts"
}
}
target "alpine-stable" {
inherits = ["_multiplatform_image"]
target = "bootable-alpine"
tags = tags("alpine-stable")
args = {
FLAVOR = "stable"
}
}
target "alpine-virt" {
inherits = ["_multiplatform_image"]
target = "bootable-alpine"
tags = tags("alpine-virt")
args = {
FLAVOR = "virt"
CMDLINE = "console=tty0 console=ttyS0"
INITTAB_TTYS = <<-EOF
tty1::respawn:/sbin/getty 38400 tty1
ttyS0::respawn:/sbin/getty -L 0 ttyS0 vt100
EOF
}
}
target "_multiplatform_image" {
platforms = split(",", "${PLATFORMS}")
}
target "test" {
name = "test-${item.flavor}-${item.format}-${item.ucode}"
matrix = {
item = [
{format = "efi", ucode="intel", flavor="lts"},
{format = "raw", ucode="intel", flavor="stable"},
{format = "iso", ucode="amd", flavor="lts"},
{format = "qcow2", ucode="none", flavor="virt"},
{format = "vmdk", ucode="none", flavor="virt"},
{format = "vhdx", ucode="none", flavor="virt"},
{format = "vdi", ucode="none", flavor="virt"}
]
}
target = "test"
output = ["type=cacheonly"]
args = {
FLAVOR = "${item.flavor}"
FORMAT = "${item.format}"
UCODE = "${item.ucode}"
}
}
function "tags" {
params = [name]
result = [
"${REPOSITORY}/${name}:latest",
notequal(TAG, "") ? "${REPOSITORY}/${name}:${TAG}" : ""
]
}