From ede32747b5681073290e9966419861d69445bdd5 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 7 Dec 2021 20:07:21 +0100 Subject: [PATCH] add common args bake target Signed-off-by: CrazyMax --- docker-bake.hcl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docker-bake.hcl b/docker-bake.hcl index 731ed0cc64..b8dbed6aec 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,3 +1,6 @@ +variable "GO_VERSION" { + default = "1.16.11" +} variable "VERSION" { default = "" } @@ -16,11 +19,19 @@ variable "COMPANY_NAME" { default = "" } +target "_common" { + args = { + GO_VERSION = GO_VERSION + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + group "default" { targets = ["binary"] } target "binary" { + inherits = ["_common"] target = "binary" platforms = ["local"] output = ["build"] @@ -40,6 +51,7 @@ target "dynbinary" { } target "plugins" { + inherits = ["_common"] target = "plugins" platforms = ["local"] output = ["build"] @@ -67,12 +79,14 @@ target "plugins-cross" { } target "lint" { + inherits = ["_common"] dockerfile = "./dockerfiles/Dockerfile.lint" target = "lint" output = ["type=cacheonly"] } target "shellcheck" { + inherits = ["_common"] dockerfile = "./dockerfiles/Dockerfile.shellcheck" target = "shellcheck" output = ["type=cacheonly"]