From 8617b340e21f6adc0cd496c7656a020d7ebf225d Mon Sep 17 00:00:00 2001 From: Michal Skalski Date: Thu, 4 Aug 2016 21:35:39 +0200 Subject: 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 --- build/docker/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'build') 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 -- cgit 1.2.3-korg