Skip to content

Commit

Permalink
[build]: support specifying builder mount point and workdir (#2214)
Browse files Browse the repository at this point in the history
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 <ishida@nel-america.com>
  • Loading branch information
ishidawataru authored and lguohan committed Nov 5, 2018
1 parent f01ebfd commit 4b21ff1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -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,)
Expand Down

0 comments on commit 4b21ff1

Please sign in to comment.