bakefile: Remove default value of DOCKER_GITCOMMIT

"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 <pawel.gronowski@docker.com>
(cherry picked from commit d7a9f15775)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-07-31 18:32:01 +02:00
parent f1cc5760d9
commit 3ce0dc7e35
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -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