Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/sudoers.d is not shared from OS X and is not known to Docker. #56

Open
lwaldron opened this issue May 13, 2020 · 2 comments
Open

Comments

@lwaldron
Copy link

After a recent Docker upgrade I found bulker broken, e.g. this command from waldronlab/bioconductor but the same for all bulker commands:

$ Rdev
WARNING: Published ports are discarded when using host network mode
docker: Error response from daemon: Mounts denied: 
The path /etc/sudoers.d
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
.
ERRO[0000] error waiting for container: context canceled 

To show the bulker script:

$ cat `which Rdev`
#!/bin/sh

docker run --rm --init \
  -it --volume=/Users/lwaldron/R/bioc-devel:/usr/local/lib/R/host-site-library -e DISABLE_AUTH=true -p 8788:8787 -v /Users/lwaldron:/home/rstudio \
  --user=$(id -u):$(id -g) \
  --network="host" \
  --env "DISPLAY" \
  --volume "$HOME:$HOME" \
  --volume="/etc/group:/etc/group:ro" \
  --volume="/Users/lwaldron/templates/mac_passwd:/etc/passwd:ro" \
  --volume="/etc/shadow:/etc/shadow:ro"  \
  --volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
  --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
  --workdir="`pwd`" \

Note, I can see /etc/sudoers.d from the command line:

$ ls -al /etc/sudoers.d
total 0
drwxr-xr-x    2 root  wheel    64 Aug 18  2018 .
drwxr-xr-x  125 root  wheel  4000 May  4 11:32 ..

But I can't find it from the Docker client "File Sharing" graphical directory selection, so I didn't find a fix there. However, by removing the line:

  --volume="/etc/sudoers.d:/etc/sudoers.d:ro" \

from which Rdev, the problem went away. Doing the same to which _Rdev I see I don't have sudo access, but otherwise everything seems fine:

$ _Rdev
Starting interactive docker shell for image 'waldronlab/bioconductor:devel' and command 'Rdev'
WARNING: Published ports are discarded when using host network mode
lwaldron@docker-desktop:~$ whoami
lwaldron
lwaldron@docker-desktop:~$ sudo ls
sudo: unknown user: root
sudo: unable to initialize policy plugin
lwaldron@docker-desktop:~$

So perhaps the mac-fix script should just remove the sudoers line?

@nsheff
Copy link
Member

nsheff commented May 13, 2020

@stolarczyk
Copy link
Member

I also experienced this issue on my mac.

First I tried adding the entire /etc in "File sharing". It has been added, but when I tried to use an executable that wanted to access the sudoers file I got an error:

docker: Error response from daemon: Mounts denied: EOF.
time="2020-08-20T10:36:36-04:00" level=error msg="error waiting for container: context canceled"

So I tried sharing just the file: /etc/sudoers.d, and it worked just fine.

Not sure if that's specific to my setup, but wanted to record this in case sb is looking for a solution in the future.

docker version info:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants