-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathdocker-bake.hcl
More file actions
69 lines (60 loc) · 2.4 KB
/
docker-bake.hcl
File metadata and controls
69 lines (60 loc) · 2.4 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
// docker-bake.hcl — Declarative multi-image build configuration
// All sandbox image variants built in a single `bake` invocation.
// Bake builds targets in parallel, deduplicates shared base stages.
//
// Usage:
// TAG=pr-42 SANDBOX_VERSION=0.1.0 docker buildx bake main
// CACHE_REPO=ghcr.io/org/repo/cache TAG=main docker buildx bake main
variable "TAG" { default = "dev" }
variable "SANDBOX_VERSION" { default = "dev" }
variable "BUN_VERSION" { default = "1.3" }
variable "CACHE_REPO" { default = "" }
// main: all variants needed for E2E testing (CF registry)
group "main" {
targets = ["default", "python", "opencode", "musl", "desktop"]
}
// publish: variants published to Docker Hub (standalone excluded — CF registry only)
group "publish" {
targets = ["default", "python", "opencode", "musl", "desktop"]
}
target "_common" {
context = "."
dockerfile = "packages/sandbox/Dockerfile"
platforms = ["linux/amd64"]
args = { SANDBOX_VERSION = SANDBOX_VERSION, BUN_VERSION = BUN_VERSION }
}
target "default" {
inherits = ["_common"]
target = "default"
tags = ["sandbox:${TAG}"]
cache-from = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:default"] : []
cache-to = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:default,mode=max"] : []
}
target "python" {
inherits = ["_common"]
target = "python"
tags = ["sandbox-python:${TAG}"]
cache-from = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:python"] : []
cache-to = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:python,mode=max"] : []
}
target "opencode" {
inherits = ["_common"]
target = "opencode"
tags = ["sandbox-opencode:${TAG}"]
cache-from = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:opencode"] : []
cache-to = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:opencode,mode=max"] : []
}
target "musl" {
inherits = ["_common"]
target = "musl"
tags = ["sandbox-musl:${TAG}"]
cache-from = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:musl"] : []
cache-to = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:musl,mode=max"] : []
}
target "desktop" {
inherits = ["_common"]
target = "desktop"
tags = ["sandbox-desktop:${TAG}"]
cache-from = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:desktop"] : []
cache-to = CACHE_REPO != "" ? ["type=registry,ref=${CACHE_REPO}:desktop,mode=max"] : []
}