-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
74 lines (62 loc) · 1.38 KB
/
docker-bake.hcl
File metadata and controls
74 lines (62 loc) · 1.38 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
# Special target: https://github.com/docker/metadata-action#bake-definition
target "docker-metadata-action" {
tags = ["github-builder:local"]
}
group "default" {
targets = ["hello-cross"]
}
group "grp" {
targets = ["go", "hello"]
}
variable "XX_VERSION" {
default = null
}
target "go" {
inherits = ["docker-metadata-action"]
args = {
XX_VERSION = XX_VERSION
}
dockerfile = "go.Dockerfile"
}
target "go-cross" {
inherits = ["go"]
platforms = ["linux/amd64", "linux/arm64"]
}
target "hello" {
inherits = ["docker-metadata-action"]
dockerfile = "hello.Dockerfile"
}
target "hello-cross" {
inherits = ["hello"]
platforms = ["linux/amd64", "linux/arm64"]
}
target "go-cross-with-contexts" {
inherits = ["go-cross"]
contexts = {
gen = "target:generated-files"
}
}
target "generated-files" {
contexts = {
generated-hello1 = "target:generated-hello1"
generated-hello2 = "target:generated-hello2"
}
dockerfile-inline = <<-EOT
FROM scratch AS generated-files
COPY --from=generated-hello1 / /hello1
COPY --from=generated-hello2 / /hello2
EOT
output = ["type=cacheonly"]
}
target "generated-hello1" {
dockerfile = "hello.Dockerfile"
output = ["type=cacheonly"]
}
target "generated-hello2" {
dockerfile = "hello.Dockerfile"
output = ["type=cacheonly"]
}
target "dhi" {
inherits = ["docker-metadata-action"]
dockerfile = "dhi.Dockerfile"
}