summaryrefslogtreecommitdiffstats
path: root/build/docker/Makefile
diff options
context:
space:
mode:
authorMichal Skalski <mskalski@mirantis.com>2016-08-08 07:32:41 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-08-08 07:32:41 +0000
commitaa5d41bfa5ecdf5c53512194a9816cbec95b4da2 (patch)
tree02e43ea534bf8d4de2bb69e01856a9ea6872d7b6 /build/docker/Makefile
parentcf58d9d488fde91a5177ae01363844da8ec8441c (diff)
parent8617b340e21f6adc0cd496c7656a020d7ebf225d (diff)
Merge "Don't use -f flag with docker tag"
Diffstat (limited to 'build/docker/Makefile')
-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