aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorMichal Skalski <mskalski@mirantis.com>2016-08-04 21:35:39 +0200
committerMichal Skalski <mskalski@mirantis.com>2016-08-05 01:07:10 +0200
commit8617b340e21f6adc0cd496c7656a020d7ebf225d (patch)
tree9951cc178c505d9264f1db069354d2729b7c8ade /build
parentf0463e6234cd27eaa2e0cd3ded0b035d89aa918c (diff)
Don't use -f flag with docker tag
-f flag has been deprecated since v1.10.0 and is removed from v1.12.0. If user use recent version of docker iso built will fail. https://docs.docker.com/engine/deprecated/#/f-flag-on-docker-tag JIRA: FUEL-163 Change-Id: If42781f342d59db7672322ec07063d09a23e1dcb Signed-off-by: Michal Skalski <mskalski@mirantis.com>
Diffstat (limited to 'build')
-rw-r--r--build/docker/Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/build/docker/Makefile b/build/docker/Makefile
index a2434447a..d4423b0a2 100644
--- a/build/docker/Makefile
+++ b/build/docker/Makefile
@@ -10,6 +10,15 @@
SHELL = /bin/bash
FILES = $(wildcard ubuntu-builder/*) runcontext
+DOCKER_VER := $(shell [[ "$$(docker version --format '{{.Client.Version}}')" =~ ([0-9]+)\.([0-9]+) ]] && echo $$(( $${BASH_REMATCH[1]} * 100 + $${BASH_REMATCH[2]} )))
+
+# Don't use -f flag when docker is newer than 1.9
+# https://docs.docker.com/engine/deprecated/#/f-flag-on-docker-tag
+ifeq ($(shell echo "$(DOCKER_VER)>109" | bc), 1)
+ tag_flags :=
+else
+ tag_flags := -f
+endif
.PHONY: all
all: .docker
@@ -25,7 +34,7 @@ all: .docker
test -n "${NO_PROXY}" && sed -i "s;INSERT_NO_PROXY;${NO_PROXY};" ubuntu-builder/Dockerfile || exit 0
sed -i '/INSERT_/d' ubuntu-builder/Dockerfile
/usr/bin/docker build --rm=true --no-cache=true -t opnfv.org/ubuntu-builder:14.04 ubuntu-builder
- /usr/bin/docker tag -f opnfv.org/ubuntu-builder:14.04 opnfv.org/ubuntu-builder
+ /usr/bin/docker tag ${tag_flags} opnfv.org/ubuntu-builder:14.04 opnfv.org/ubuntu-builder
touch .docker
.PHONY: clean