Hi team,

I had some queries and was seeking some opinions on 
https://github.com/projectatomic/adb-atomic-developer-bundle/issues/118 about 
mounted volumes not being accessible from the host

It says,
Mounted volumes on Docker containers should be accessible from the Host VM, so 
a user can deploy his application from his IDE on the Host VM into the mounted 
volume (ie, a specific directory in the host VM) and the application server in 
the Docker container will be able to pick the changes automatically.

The way I understand, what we are trying to achieve is:

Mounting volumes from host to guest (problem), then guest to Docker containers 
(not a problem)

Possible solutions: 

---

One way sync from host to guest:

Linux: This is what Vagrant does by default (rsync), and as already pointed out 
on the GitHub issue page, `vagrant rsync-auto` can be used for a continuous one 
way sync

Windows: rsync will have to be packaged with the installer (Cygwin has it?) 
(not tested rsync, yet)

---

Two way sync from host to guest:

Solution 1 - SSHFS (vagrant-sshfs plugin) (testing in progress)

Pros:
- One solution for all platforms

Cons:
- No longer maintained, so it has to be maintained by us since it might break 
with future Vagrant versions
- Performance issues (high latency, reliable over heavy load?) since it's 
working over SSH
- SSH server has to be packaged with the Windows installer

--

Solution 2 - NFS (Linux + Mac) and SMB (Windows)

https://www.vagrantup.com/docs/synced-folders/nfs.html
https://www.vagrantup.com/docs/synced-folders/smb.html

Pros:
- Maintained by Vagrant, so easier to maintain. Also, this will have more 
testing and user feedback backing it than our customized vagrant-sshfs plugin 
will have.
- Works out of the box, just one `vagrant up`
- No tinkering required on the Windows host (but NFS server required on Linux 
and Mac hosts)

Cons:
- The Vagrantfile gets a bit typical to understand, but can we also make this 
solution into a plugin (don't know how that works)?
- Multiple solutions for one problem, but both of these are well built in and 
their implementation (mounts) is automated and hidden away from the end user, 
so no change in the user experience, rather it is more seamless
- Vagrant is not 'supposed' to maintain these in the future, but if we have to 
maintain the solution, then why not this than vagrant-sshfs?

I have tried out the second solution and the resultant Vagrantfile might look 
something like this,
https://raw.githubusercontent.com/containscafeine/dots/master/Vagrantfile 
(please change the mount points according to your environment)

This Vagrantfile will not work out of the box since Vagrant does not provision 
before mounting the synced folders, but it should not matter if cifs-utils is 
packaged inside the adb vagrant box, so if someone wants to try it:

Steps for Windows:
- `vagrant up`
- `vagrant provision`
- `vagrant reload`

Steps for Linux:
- Allow incoming connections to the NFS server on the host
- `vagrant up`

---

Please correct me if I did not understand the issue correctly or stated 
something off track,
Regards,
Shubham

_______________________________________________
Container-tools mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/container-tools

Reply via email to