Skip to content

Commit 17f1f38

Browse files
author
Wataru Ishida
committed
[build]: support specifying builder mount point and workdir
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 <[email protected]>
1 parent 8b67424 commit 17f1f38

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Makefile.work

+10-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,17 @@ OVERLAY_MODULE_CHECK := lsmod | grep "^overlay " > /dev/null 2>&1 || (echo "ERRO
6363

6464
BUILD_TIMESTAMP := $(shell date +%Y%m%d\.%H%M%S)
6565

66+
ifeq ($(DOCKER_BUILDER_MOUNT),)
67+
override DOCKER_BUILDER_MOUNT := "$(PWD):/sonic"
68+
endif
69+
70+
ifeq ($(DOCKER_BUILDER_WORKDIR),)
71+
override DOCKER_BUILDER_WORKDIR := "/sonic"
72+
endif
73+
6674
DOCKER_RUN := docker run --rm=true --privileged \
67-
-v $(PWD):/sonic \
68-
-w /sonic \
75+
-v $(DOCKER_BUILDER_MOUNT) \
76+
-w $(DOCKER_BUILDER_WORKDIR) \
6977
-e "http_proxy=$(http_proxy)" \
7078
-e "https_proxy=$(https_proxy)" \
7179
-i$(if $(TERM),t,)

0 commit comments

Comments
 (0)