Comments (6)
@carloslozano Thanks for pointing on this!
To mount Mac host's folder to the container, we need to share this folder with the VM at first.
As you have noticed, currently only .
dir is shared (location of Vagrantfile):
config.vm.synced_folder ".", Dir.pwd
boot2docker-vagrant-box/vagrantfile.tpl
Line 12 in a95b7bf
That's why only children of
.
can be mounted to the Docker container.
I think, we should change this behavior and share the entire /Users
directory by default, like "boot2docker" and "Docker Machine" projects do. It will cover the most of use cases, including the one you've mentioned above, with $HOME
mapping.
P.s. Limitations: we can not share the OS X root (/
) and paths like /var
, /usr
or /tmp
because they already exists on Linux filesystem in your boot2docker VM and these mount points will be overridden.
from boot2docker-vagrant-box.
@carloslozano Please, try to add this line to your Vagrantfile, do vagrant reload
and then try to reproduce an issue:
config.vm.synced_folder "/Users", "/Users"
Does it work for you now?
from boot2docker-vagrant-box.
@legal90 Thanks for your reply. 👍
I think it would be excellent if boot2docker-vagrant-box could emulate the behaviour of the boot2docker virtualbox as closely as possible. It would really facilitate the migration from virtualbox to parallels; I encountered the aforementioned issue during such a migration and couldn't find any reference anywhere to this behaviour/limitation. In the meantime, a note in the documentation with regard to the current caveats would be helpful to avoid others from falling over the same stone 😉
if I understand correctly, to share any sub-paths of /User
we must first share this parent path with the boot2docker-vagrant-box, right? This way any /User/*
path could be shared (i.e. /Users/<xyz>/mysharedfolder
) and be mapped and shared correctly with the docker instance.
As long as the access to the boot2docker-vagrant-box
instance is secure, I don't see a problem a with mapping all of /Users
by default; the boot2docker-vagrant-box
is executing under a specific user and , as such, can only access sub-paths to which it has sufficient permissions. It would a good recommendation to avoid running the boot2docker-vagrant-box
as root in this case. 😏
from boot2docker-vagrant-box.
@legal90 I've just tried your recommendation.
Added to Vagrantfile:
config.vm.synced_folder "/Users", "/Users"
Testing:
docker run -P -v /Users/adaptive/tmp:/home/adaptive/tmp <image> df -k
Result:
Filesystem 1K-blocks Used Available Use% Mounted on
none 40158812 7019148 31076664 19% /
tmpfs 4083856 0 4083856 0% /dev
shm 65536 0 65536 0% /dev/shm
Users 975922976 179816620 796106356 19% /home/adaptive/tmp <--- :smile:
/dev/sda2 40158812 7019148 31076664 19% /etc/hosts
tmpfs 4083856 0 4083856 0% /proc/kcore
tmpfs 4083856 0 4083856 0% /proc/timer_stats
This work-around works for all sub-paths of /Users
. 👍
If I also want to share other sub-paths of, for example /Library
or /repository
, then I understand that I would have to add these parent paths to the Vagrantfile.
config.vm.synced_folder "/Users", "/Users"
config.vm.synced_folder "/Library", "/Library"
config.vm.synced_folder "/repository", "/repository"
Correct? Thanks!
from boot2docker-vagrant-box.
if I understand correctly, to share any sub-paths of /User we must first share this parent path with the boot2docker-vagrant-box, right?
If I also want to share other sub-paths of, for example /Library or /repository, then I understand that I would have to add these parent paths to the Vagrantfile.
@carloslozano Yes, you're right. /Users
is shared by default in "boot2docker" project and it's described here (section "boot2docker: Shared directories on Mac OS X"): https://blog.docker.com/2014/10/docker-1-3-signed-images-process-injection-security-options-mac-shared-directories/
I'm gonna apply the same behavior to this vagrant box and add short notice to README.md.
from boot2docker-vagrant-box.
Fixed in v1.7.1
from boot2docker-vagrant-box.
Related Issues (20)
- Cannot access my OSX files on containers HOT 6
- Update to Docker 1.7.0 HOT 8
- when will 1.7.1 be on atlas? HOT 2
- NFS mounts fail with 1.7.0 and 1.7.1 on Mavericks HOT 15
- CoreOS Vagrant Box HOT 1
- Possible to exclude folders? HOT 1
- Can't connect host docker client to VM on explicit IP HOT 2
- Error: Docker is not running on the guest VM HOT 2
- Docker 1.8 HOT 1
- Release 1.0.0 to vagrant cloud HOT 4
- unable to use chef_solo inside parallels/boot2docker HOT 2
- Docker 1.9 HOT 2
- Project support status HOT 1
- Keeping VM running on window close? HOT 2
- Upgrade to Docker 1.4.1 HOT 2
- Mounting an external disk HOT 1
- Update to 1.5 HOT 13
- Update to Docker 1.6.0 HOT 11
- vagrant up asking for password HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boot2docker-vagrant-box.