-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
46 lines (39 loc) · 944 Bytes
/
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
variable "GO_VERSION" {
default = "1.18"
}
variable "TAG" {
default = "latest"
}
variable "GITHUB_REPOSITORY_OWNER" {
default = "unknown"
}
target "_common" {
args = {
GO_VERSION = GO_VERSION
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
}
}
// docker-bake.hcl
target "docker-metadata-action" {
tags = ["devopps/hello-world-buildx:${TAG}"]
}
group "default" {
targets = ["image"]
}
target "image" {
inherits = ["_common", "docker-metadata-action"]
context = "."
dockerfile = "Dockerfile"
cache-from = ["type=registry,ref=${GITHUB_REPOSITORY_OWNER}/hello-world-buildx:latest"]
cache-to = ["type=inline"]
labels = {
"org.opencontainers.image.title"= "hello-world-buildx"
"org.opencontainers.image.ref" = "https://github.com/foo/myapp"
}
output = ["type=registry"]
}
target "image-all" {
inherits = ["image"]
platforms = ["linux/amd64", "linux/arm64", "linux/arm/v6", "linux/arm/v7"]
output = ["type=registry"]
}