From d7a9f15775e023f5675a48381c3d7d78c25dd16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Mon, 31 Jul 2023 18:32:01 +0200 Subject: [PATCH] bakefile: Remove default value of DOCKER_GITCOMMIT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "HEAD" will still be used as a version if no DOCKER_COMMIT is provided (for example when not running via `make`), but it won't prevent it being set to the GITHUB_SHA variable when it's present. This should fix `Git commit` reported by `docker version` for the binaries generated by `moby-bin`. Signed-off-by: Paweł Gronowski --- docker-bake.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index 3d9675f184..a1ac477a91 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -14,7 +14,7 @@ variable "DOCKER_BUILDTAGS" { default = "" } variable "DOCKER_GITCOMMIT" { - default = "HEAD" + default = null } # Docker version such as 23.0.0-dev. Automatically generated through Git ref. @@ -81,7 +81,7 @@ target "_common" { DOCKER_STATIC = DOCKER_STATIC DOCKER_LDFLAGS = DOCKER_LDFLAGS DOCKER_BUILDTAGS = DOCKER_BUILDTAGS - DOCKER_GITCOMMIT = DOCKER_GITCOMMIT != "" ? DOCKER_GITCOMMIT : GITHUB_SHA + DOCKER_GITCOMMIT = DOCKER_GITCOMMIT != null ? DOCKER_GITCOMMIT : GITHUB_SHA VERSION = VERSION != "" ? VERSION : GITHUB_REF PLATFORM = PLATFORM PRODUCT = PRODUCT