Skip to content

Commit 234884c

Browse files
bhouse-nexthoplguohan
authored andcommitted
Resolve PWD to pass to docker container.
In some environments, the build location may actually be a symlink to a different filesystem, resolving the actual location may resolve build issues related to docker containers, especially if authentication using kernel keyrings is required. An explicit example where this breakage occurs is in an enterprise environment where /home/$USER may be an automount NFS share using kerberos authentication. The user then has symlink of /home/$USER/work -> /work/$USER Which is a local scratch space not on the NFS share (as NFS is slow, no one should be doing builds in NFS). In this scenario, when /home/$USER/work/sonic-buildimage is passed to docker as the volume to mount as /sonic it fails because from within the container the kernel keyring with the kerberos credentials aren't passed through and it is unable to read the symlink. Pre-resolving the symlink before entering the container resolves the build issue. Signed-off-by: Brad House <[email protected]>
1 parent 5844ab7 commit 234884c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile.work

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
SHELL = /bin/bash
7070

7171
USER := $(shell id -un)
72-
PWD := $(shell pwd)
72+
PWD := $(shell realpath $(shell pwd))
7373
USER_LC := $(shell echo $(USER) | tr A-Z a-z)
7474
ifneq ($(DEFAULT_CONTAINER_REGISTRY),)
7575
DOCKER_MACHINE := $(shell docker run --rm $(DEFAULT_CONTAINER_REGISTRY)/debian:buster uname -m)

0 commit comments

Comments
 (0)