From 8d9371e023499e65bc442371f6c5dd3f66e54ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Wed, 19 Apr 2017 17:03:02 -0700 Subject: [PATCH] Put the branch name first on the version string for docker master builds Docker Hub makes a shallow clone of the git repo, so we don't have tags anyway, we end up with commit-master (e.g. 289f849-master), put the branch first so it's more human readable (master-289f849) --- hooks/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/build b/hooks/build index dfa5efd70..91ffe41a1 100755 --- a/hooks/build +++ b/hooks/build @@ -13,7 +13,7 @@ else # for everything else generate version from branch name and git tag/commit # it would be best to use SOURCE_COMMIT here, but it doesn't work # see https://github.com/docker/hub-feedback/issues/600 - VERSION=$(git describe --tags --always)-${SOURCE_BRANCH} + VERSION=${SOURCE_BRANCH}-$(git describe --always) fi docker build --build-arg VERSION=${VERSION} -t ${IMAGE_NAME} .