-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-bake.gha.hcl
61 lines (54 loc) · 1.21 KB
/
docker-bake.gha.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
# This is an HCL syntax equivalent to docker-compose.yml
# It looks good for the future, as it supports low level
# options which docker-compose does not, but it's currently very bleeding edge
variable "CACHE_SCOPE" {
default = "CI-test"
}
variable "IMAGE_TAG" {
default = ""
}
variable "REGISTRY" {
default = ""
}
variable "PUBLIC_REGISTRY" {
default = ""
}
group "default" {
targets = ["test", "postgres"]
}
target "test" {
dockerfile = "deploy/debian.Dockerfile"
target = "test-image"
context = "."
args = {
REGISTRY = "${REGISTRY}"
PUBLIC_REGISTRY = "${PUBLIC_REGISTRY}"
}
tags = [
"${REGISTRY}foo-app:test"
]
cache-from = [
"type=gha,scope=${CACHE_SCOPE}"
]
cache-to = [
"type=gha,scope=${CACHE_SCOPE},mode=max"
]
output = ["type=registry"]
}
target "postgres" {
dockerfile = "deploy/postgres.Dockerfile"
context = "."
args = {
REGISTRY = "${PUBLIC_REGISTRY}"
}
tags = [
"${REGISTRY}postgres:14-alpine"
]
cache-from = [
"type=gha,scope=${CACHE_SCOPE}"
]
cache-to = [
"type=gha,scope=${CACHE_SCOPE},mode=max"
]
output = ["type=registry"]
}