docker-engine: fix docker version output
authorChristian Stewart <christian@paral.in>
Sat, 24 Dec 2016 06:02:46 +0000 (22:02 -0800)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 25 Dec 2016 22:09:35 +0000 (23:09 +0100)
At compile-time the docker build scripts generate a version file used
to build the output of the docker version command. This file is
generated somewhat properly by the Buildroot build system, however the
version number and commit ID are incorrectly formatted. This patch fixes
the output to the correct format.

This is important as some tools like WeaveWorks won't even start unless
they can parse the Docker Version output correctly.

[Peter: strip v from version using patsusbt]
Signed-off-by: Christian Stewart <christian@paral.in>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/docker-engine/docker-engine.mk

index ade6fbb02afb846c5056c707d7563ca5ea1bdaa8..2cd71dd8982e2352724ef8b169764da86b6a4714 100644 (file)
@@ -5,6 +5,7 @@
 ################################################################################
 
 DOCKER_ENGINE_VERSION = v1.12.5
+DOCKER_ENGINE_COMMIT = 7392c3b0ce0f9d3e918a321c66668c5d1ef4f689
 DOCKER_ENGINE_SITE = $(call github,docker,docker,$(DOCKER_ENGINE_VERSION))
 
 DOCKER_ENGINE_LICENSE = Apache-2.0
@@ -67,7 +68,9 @@ endif
 define DOCKER_ENGINE_CONFIGURE_CMDS
        ln -fs $(@D) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker
        cd $(@D) && \
-               GITCOMMIT="unknown" BUILDTIME="$$(date)" VERSION="$(DOCKER_ENGINE_VERSION)" \
+               GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \
+               BUILDTIME="$$(date)" \
+               VERSION="$(patsubst v%,%,$(DOCKER_ENGINE_VERSION))" \
                PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" $(TARGET_MAKE_ENV) \
                bash ./hack/make/.go-autogen
 endef