From 9d40c7464eb2a351e8b2e63dd1fdce6a43f2c70f Mon Sep 17 00:00:00 2001 From: Morten Linderud Date: Sun, 29 Nov 2020 16:07:46 +0100 Subject: [PATCH] scripts/build/.variables: Support SOURCE_DATE_EPOCH Repeated builds of docker is currently unreproducible as the embedded time does not support SOURCE_DATE_EPOCH. This patch ensures we check for the defined variable before utilizing current date. This has been fixed previously with manpages as well https://github.com/docker/cli/commit/2d7091aaeb3dac6388d81cbb9b6847c75ee4b7b9 Signed-off-by: Morten Linderud --- scripts/build/.variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/.variables b/scripts/build/.variables index 094209cd50..1f2903521d 100755 --- a/scripts/build/.variables +++ b/scripts/build/.variables @@ -4,7 +4,7 @@ set -eu PLATFORM=${PLATFORM:-} VERSION=${VERSION:-"unknown-version"} GITCOMMIT=${GITCOMMIT:-$(git rev-parse --short HEAD 2> /dev/null || true)} -BUILDTIME=${BUILDTIME:-$(date -u +"%Y-%m-%dT%H:%M:%SZ")} +BUILDTIME=${BUILDTIME:-$(date -u --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +"%Y-%m-%dT%H:%M:%SZ")} PLATFORM_LDFLAGS= if test -n "${PLATFORM}"; then