Repository navigation
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
83 lines (70 loc) · 2.06 KB
/
Copy pathdocker-bake.hcl
File metadata and controls
83 lines (70 loc) · 2.06 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
# Build graph for the two published images.
#
# One bake invocation builds both targets, so prod-deps and the compiled bundle
# are resolved once and the two images share a single cache scope instead of the
# separate coordinator/runner scopes they used to carry.
#
# publish PUSH=true docker buildx bake -f docker-bake.hcl
# PR dry run docker buildx bake -f docker-bake.hcl --set '*.output=type=cacheonly'
# local image docker build --target coordinator . (compiles via the builder stage)
variable "COORDINATOR_TAGS" {
default = "agylity:verify"
}
variable "RUNNER_TAGS" {
default = "agylity-runner:verify"
}
# Directory holding the prebuilt bundle as `<dir>/app/dist`, supplied by CI.
# Empty means "compile inside Docker" through the builder stage.
variable "DIST_CONTEXT" {
default = ""
}
variable "PUSH" {
default = "false"
}
variable "REPOSITORY" {
default = "otterboops/agylity"
}
variable "REVISION" {
default = ""
}
variable "VERSION" {
default = ""
}
variable "CREATED" {
default = ""
}
variable "BASE_IMAGE" {
default = "base"
}
group "default" {
targets = ["coordinator", "runner"]
}
target "_common" {
context = "."
dockerfile = "Dockerfile"
contexts = DIST_CONTEXT == "" ? {} : { dist = DIST_CONTEXT }
args = {
BASE_IMAGE = BASE_IMAGE
}
output = ["type=image,push=${PUSH},compression=zstd,oci-mediatypes=true"]
labels = {
"org.opencontainers.image.source" = "https://github.com/${REPOSITORY}"
"org.opencontainers.image.revision" = REVISION
"org.opencontainers.image.version" = VERSION
"org.opencontainers.image.created" = CREATED
}
cache-from = ["type=gha,scope=agylity"]
cache-to = ["type=gha,mode=max,scope=agylity"]
}
target "coordinator" {
inherits = ["_common"]
target = "coordinator"
tags = split(",", COORDINATOR_TAGS)
cache-from = ["type=gha,scope=agylity", "type=gha,scope=coordinator"]
}
target "runner" {
inherits = ["_common"]
target = "runner"
tags = split(",", RUNNER_TAGS)
cache-from = ["type=gha,scope=agylity", "type=gha,scope=runner"]
}