Skip to content

Commit de8d569

Browse files
committed
add common args bake target
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
1 parent 4db5a4f commit de8d569

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docker-bake.hcl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
variable "GO_VERSION" {
2+
default = "1.16.11"
3+
}
14
variable "VERSION" {
25
default = ""
36
}
@@ -16,11 +19,19 @@ variable "COMPANY_NAME" {
1619
default = ""
1720
}
1821

22+
target "_common" {
23+
args = {
24+
GO_VERSION = GO_VERSION
25+
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
26+
}
27+
}
28+
1929
group "default" {
2030
targets = ["binary"]
2131
}
2232

2333
target "binary" {
34+
inherits = ["_common"]
2435
target = "binary"
2536
platforms = ["local"]
2637
output = ["build"]
@@ -40,6 +51,7 @@ target "dynbinary" {
4051
}
4152

4253
target "plugins" {
54+
inherits = ["_common"]
4355
target = "plugins"
4456
platforms = ["local"]
4557
output = ["build"]
@@ -67,12 +79,14 @@ target "plugins-cross" {
6779
}
6880

6981
target "lint" {
82+
inherits = ["_common"]
7083
dockerfile = "./dockerfiles/Dockerfile.lint"
7184
target = "lint"
7285
output = ["type=cacheonly"]
7386
}
7487

7588
target "shellcheck" {
89+
inherits = ["_common"]
7690
dockerfile = "./dockerfiles/Dockerfile.shellcheck"
7791
target = "shellcheck"
7892
output = ["type=cacheonly"]

0 commit comments

Comments
 (0)