-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
152 lines (131 loc) · 3.07 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
variable "GO_VERSION" {
default = "1.17"
}
variable "REPO" {
default = "pratikimprowise/tarrer"
}
variable "VERSION" {
default = "edge"
}
variable "GIT_SHA" {
default = "0000000"
}
variable "TAGS" {
default = [
"${REPO}:latest",
"${REPO}:${VERSION}",
"${REPO}:${VERSION}-${GIT_SHA}"
]
}
variable "TAGS_SLIM" {
default = [
"${REPO}:slim",
"${REPO}:slim-latest",
"${REPO}:slim-${VERSION}",
"${REPO}:slim-${VERSION}-${GIT_SHA}"
]
}
target "_common" {
args = {
GO_VERSION = GO_VERSION
}
}
target "_labels" {
labels = {
"org.opencontainers.image.title" = "tarrer",
"org.opencontainers.image.authors" = "pratikbalar",
"org.opencontainers.image.base.name " = "scratch",
"org.opencontainers.image.licenses" = "Apache-2.0",
"org.opencontainers.image.description" = "Dumb br, bz2, zip, gz, lz4, sz, xz, zstd extractor",
"org.opencontainers.image.version" = "${VERSION}",
"org.opencontainers.image.revision" = "${GIT_SHA}",
"org.opencontainers.image.source" = "https://github.com/pratikbalar/tarrer",
"org.opencontainers.image.documentation" = "https://github.com/pratikbalar/tarrer",
}
}
target "_slim" {
target = "slim"
tags = TAGS_SLIM
}
target "_fat" {
target = "fat"
tags = TAGS
}
target "artifacs" {
output = ["./dist"]
}
target "image-platform" {
platforms = [
"linux/amd64",
"linux/arm64",
"linux/riscv64",
"linux/ppc64le",
"linux/s390x",
"linux/386",
"linux/mips64le",
"linux/mips64",
"linux/arm/v7",
"linux/arm/v6"
]
}
target "bin-platform" {
platforms = [
"linux/amd64",
"linux/386",
"linux/arm64",
"linux/arm/v5",
"linux/arm/v6",
"linux/arm/v7",
"linux/ppc64le",
"linux/riscv64",
"linux/s390x",
"freebsd/amd64",
"freebsd/386",
"freebsd/arm64",
"freebsd/arm",
"windows/amd64",
"windows/arm64",
"windows/arm",
"windows/386",
"darwin/amd64",
"darwin/arm64",
]
}
group "default" {
targets = ["artifact"]
}
# Creating fat container image for local docker
target "image-local" {
inherits = ["_common", "_fat", "_labels"]
output = ["type=docker"]
}
# Creating slim container image for local docker
target "image-slim" {
inherits = ["_common", "_slim", "_labels"]
output = ["type=docker"]
}
# Creating fat container image for all platforms
target "image-all" {
inherits = ["_common", "image-platform", "_fat", "_labels"]
target = "fat"
}
# Creating slim container image for all platforms
target "image-slim-all" {
inherits = ["_common", "image-platform", "_slim", "_labels"]
target = "slim"
}
# Creating all fat artifact for all platforms
target "artifact" {
inherits = ["_common", "artifacs"]
target = "artifact"
}
# Creating all slim artifact for all platforms
target "artifact-slim" {
inherits = ["_common", "artifacs"]
target = "artifact-slim"
}
# Creating all full, slim artifact for all platforms
target "artifact-all" {
inherits = ["artifact-all", "artifacs", "bin-platform", ]
target = "artifact-all"
}