From 4b21ff167fc96cbc421a2bb2669581c5ef1e41e2 Mon Sep 17 00:00:00 2001 From: Wataru Ishida <5915117+ishidawataru@users.noreply.github.com> Date: Mon, 5 Nov 2018 10:44:06 -0800 Subject: [PATCH] [build]: support specifying builder mount point and workdir (#2214) This can be used when sonic-buildimage repo is a git submodule of other repo. e.g) if sonic-buildimage is a git submodule of "parent" repo and sonic-buildimage is just under the top directory of "parent" repo, we can build sonic-buildimage like below $ cd parent/sonic-buildimage $ DOCKER_BUILDER_MOUNT=`realpath ../`:`realpath ../` \ DOCKER_BUILDER_WORKDIR=`pwd` make all Signed-off-by: Wataru Ishida --- Makefile.work | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile.work b/Makefile.work index 94571239e0a5..6c4828134a8a 100644 --- a/Makefile.work +++ b/Makefile.work @@ -63,9 +63,17 @@ OVERLAY_MODULE_CHECK := lsmod | grep "^overlay " > /dev/null 2>&1 || (echo "ERRO BUILD_TIMESTAMP := $(shell date +%Y%m%d\.%H%M%S) +ifeq ($(DOCKER_BUILDER_MOUNT),) +override DOCKER_BUILDER_MOUNT := "$(PWD):/sonic" +endif + +ifeq ($(DOCKER_BUILDER_WORKDIR),) +override DOCKER_BUILDER_WORKDIR := "/sonic" +endif + DOCKER_RUN := docker run --rm=true --privileged \ - -v $(PWD):/sonic \ - -w /sonic \ + -v $(DOCKER_BUILDER_MOUNT) \ + -w $(DOCKER_BUILDER_WORKDIR) \ -e "http_proxy=$(http_proxy)" \ -e "https_proxy=$(https_proxy)" \ -i$(if $(TERM),t,)