diff --git a/Makefile b/Makefile
index 4f6e7ef8f03df25f0d3266d1d5f3e01a35d42c02..aae5e0391c9faa25aacc9c35f3f4cbb88bce798b 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ GOBIN = $(CURDIR)/build/bin
 
 GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
 GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
-GIT_TAG    ?= $(shell git describe --tags --dirty)
+GIT_TAG    ?= $(shell git describe --tags '--match=v*' --dirty)
 
 CGO_CFLAGS := $(shell $(GO) env CGO_CFLAGS) # don't loose default
 CGO_CFLAGS += -DMDBX_FORCE_ASSERTIONS=1 # Enable MDBX's asserts by default in 'devel' branch and disable in 'stable'
diff --git a/hooks/build b/hooks/build
new file mode 100755
index 0000000000000000000000000000000000000000..b5a49356f1345855a37f49dfcebfcff07ebb510b
--- /dev/null
+++ b/hooks/build
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# This is needed to pass build ARGs to Dockerfile.
+# see https://docs.docker.com/docker-hub/builds/advanced/
+
+DOCKER_FLAGS="-t $IMAGE_NAME" \
+GIT_TAG=$(git describe --tags '--match=v*' --dirty) \
+    make docker
diff --git a/hooks/post_checkout b/hooks/post_checkout
old mode 100644
new mode 100755