From 39b641eb8979ecad0d8cf4c66d08418f4b5567bc Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Tue, 23 Jul 2019 07:01:21 -0700 Subject: [PATCH] [build]: Fix comparing docker versions in build (#3205) --- Makefile.work | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.work b/Makefile.work index cd867a46ef..6bd3612750 100644 --- a/Makefile.work +++ b/Makefile.work @@ -46,7 +46,7 @@ endif # Note: Using the greater of CE (17.05.0) and EE (17.06.1) versions that support ARG before FROM docker_min := 17.06.1 docker_min_ver := $(shell echo "$(docker_min)" | awk -F. '{printf("%d%03d%03d\n",$$1,$$2,$$3);}' 2>/dev/null) -docker_ver := $(shell docker info 2>/dev/null | grep -i "server version" | cut -d' ' -f3 | awk -F. '{printf("%d%03d%03d\n",$$1,$$2,$$3);}' 2>/dev/null) +docker_ver := $(shell docker info 2>/dev/null | grep -i "server version" | rev | cut -d' ' -f1 | rev | awk -F. '{printf("%d%03d%03d\n",$$1,$$2,$$3);}' 2>/dev/null) docker_is_valid := $(shell if [ $(docker_ver) -lt $(docker_min_ver) ] ; then echo "0"; else echo "1"; fi) ifeq (0,$(docker_is_valid)) $(error SONiC requires Docker version $(docker_min) or later)