Docker Community Forums

Share and learn in the Docker community.

Unable to mount dir in / of host

beta

(Mrfuture) #1

Expected behavior

When running:
docker run -it -v /builds:/builds centos:7.2.1511 bash

My Mac’s /builds directory should be accessible via the resulting container. /builds has the same ownership and permission of my home directory, which DOES mount.

Actual behavior

/builds is mounted using tmpfs filesystem.

[root@c2e042a3953e /]# df -h
Filesystem Size Used Avail Use% Mounted on
none 60G 747M 56G 2% /
tmpfs 1001M 0 1001M 0% /dev
tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
tmpfs 1001M 175M 826M 18% /builds
/dev/vda2 60G 747M 56G 2% /etc/hosts
shm 64M 0 64M 0% /dev/shm

Steps to reproduce the behavior

Already decribed.


(Jasonhillier) #2

+1

I’m seeing the same. It seems it is only possible to mount directories within the home dir on the host machine. Tried many different permissions/ownership settings.


(David Sheets) #3

Hello,

Currently (Beta 16), Docker for Mac has a fixed set of exported directories which are placed into the bind mount -v namespace. These paths are /Users, /Volumes, /private, and /tmp. To access other paths, during the Beta only, you can prefix the path with /Mac. For example, to mount /builds into a container, use -v /Mac/builds:/builds. See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more information. Configurable export path support will be released soon.

Thanks for participating in the Docker for Mac Beta!


(Mrfuture) #4

Great, thanks. Keep up the fantastic work!