From 9d089beb8475ecb6f10f0f59b785e78fe5af67f1 Mon Sep 17 00:00:00 2001 From: Antony Rheneus Date: Tue, 30 Jul 2019 18:24:52 +0530 Subject: [PATCH] [Makefile/slave-docker] Fixes for multi arch in Dockerfile Fix for rules/config as it is overridden by Make infra Signed-off-by: Antony Rheneus --- Makefile.work | 2 +- slave.mk | 3 ++- sonic-slave/Dockerfile.j2 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.work b/Makefile.work index 8d17da45b0ae..389f3f7c831f 100644 --- a/Makefile.work +++ b/Makefile.work @@ -53,7 +53,7 @@ endif 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" | 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) +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) endif diff --git a/slave.mk b/slave.mk index 3cef3fc5ef4f..a80c1125682c 100644 --- a/slave.mk +++ b/slave.mk @@ -81,6 +81,8 @@ list : ## Include other rules ############################################################################### +include $(RULES_PATH)/config + ifeq ($(SONIC_ENABLE_PFCWD_ON_START),y) ENABLE_PFCWD_ON_START = y endif @@ -97,7 +99,6 @@ ifeq ($(SONIC_INSTALL_DEBUG_TOOLS),y) INSTALL_DEBUG_TOOLS = y endif -include $(RULES_PATH)/config include $(RULES_PATH)/functions include $(RULES_PATH)/*.mk ifneq ($(CONFIGURED_PLATFORM), undefined) diff --git a/sonic-slave/Dockerfile.j2 b/sonic-slave/Dockerfile.j2 index a5f02a6929a8..91ed039a2d64 100644 --- a/sonic-slave/Dockerfile.j2 +++ b/sonic-slave/Dockerfile.j2 @@ -360,6 +360,6 @@ RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker # For jenkins slave -RUN echo "deb [arch=amd64] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list +RUN echo "deb [arch={{ CONFIGURED_ARCH }}] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list RUN apt-get -o Acquire::Check-Valid-Until=false update RUN apt-get -y -o Acquire::Check-Valid-Until=false install ca-certificates-java=20161107~bpo8+1 openjdk-8-jdk