-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-bake.hcl
97 lines (80 loc) · 1.47 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
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
group "default" {
targets = ["bookworm-prod"]
}
target "metadata-action" {}
variable "NODE_VERSION" {
default = null
}
variable "VARIANT" {
default = null
}
variable "PUSH" {
default = "false"
}
function "_output" {
params = [push]
result = push ? "type=registry" : "type=oci,dest=/tmp/container.oci"
}
variable "CI" {
default = "false"
}
function "_secrets" {
params = [ci]
result = ci ? [
"id=domain,env=MICROCMS_SERVICE_DOMAIN",
"id=key,env=MICROCMS_API_KEY",
"id=secret,env=MICROCMS_SECRET",
] : [
"id=domain,src=docker/private/microcms/service_domain.txt",
"id=key,src=docker/private/microcms/api_key.txt",
"id=secret,src=docker/private/microcms/secret.txt",
]
}
target "_platforms" {
platforms = [
"linux/amd64",
"linux/arm64",
]
}
target "_args" {
args = {
"VARIANT" = VARIANT,
"NODE_VERSION" = NODE_VERSION,
}
}
target "_base" {
inherits = ["_args"]
args = {
"BUILDKIT_SBOM_SCAN_CONTEXT" = "true",
}
attest = [
"type=sbom",
"type=provenance,mode=max",
]
context = "."
dockerfile = "docker/Dockerfile"
secret = _secrets(CI)
output = [_output(PUSH)]
}
target "bookworm-prod" {
target = "runtime"
args = {
"VARIANT" = "bookworm",
}
inherits = [
"metadata-action",
"_platforms",
"_base",
]
}
target "bookworm-dev" {
target = "development"
args = {
"VARIANT" = "bookworm",
}
inherits = [
"metadata-action",
"_platforms",
"_base",
]
}