diff --git a/Makefile.work b/Makefile.work index 1809e2b6c0d8..c9d0baf2286b 100644 --- a/Makefile.work +++ b/Makefile.work @@ -63,9 +63,11 @@ OVERLAY_MODULE_CHECK := lsmod | grep "^overlay " > /dev/null 2>&1 || (echo "ERRO BUILD_TIMESTAMP := $(shell date +%Y%m%d\.%H%M%S) +GIT_DIRECTORY := $(shell file .git | grep -q ASCII && awk '{split($$2, ary, ".git"); print ary[1]}' .git | xargs realpath || pwd ) + DOCKER_RUN := docker run --rm=true --privileged \ - -v $(PWD):/sonic \ - -w /sonic \ + -v $(GIT_DIRECTORY):$(GIT_DIRECTORY) \ + -w $(PWD) \ -e "http_proxy=$(http_proxy)" \ -e "https_proxy=$(https_proxy)" \ -i$(if $(TERM),t,)