From 6f77f7133c4484b17fb6fb61768196b0c75dca80 Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 2 Jun 2020 21:43:23 +0200 Subject: [PATCH] fix: correctly set image labels build time --- hooks/build | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 hooks/build diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..4c69a76 --- /dev/null +++ b/hooks/build @@ -0,0 +1,10 @@ +#!/bin/bash + +# as per https://github.com/rossf7/label-schema-automated-build + +# $IMAGE_NAME var is injected into the build so the tag is correct. + +echo "Build hook running" +docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + -t $IMAGE_NAME .