-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Vagrant mapped folder appears to erase contents of Docker volume #7517
Comments
Hi @AgentCormac Thank you for opening an issue. I'm having trouble following though, because you seem to switch between
|
@sethvargo. Thanks for taking a look at this.
|
Creating a new file in the C:/dev/vagrant/workspace/SpringMVCHibernate/shared-data/postgres/data directory sees the file mirrored in the mapped folder on the dockerhost. Its almost as if the container spins up, created the data directory and contents (postgres DB files) and then Vagrant maps the host folder (empty) over the top of the populated container folder making it and the dockerhost folder empty the same as the host. |
Hi @AgentCormac I think this is how vbox shared folders work. Have you tried using rsync or nfs instead? |
I had a similar issue in which i ended up with duplicated shared folders and duplicated volumes, but in my case i used SMB. Vagrant was defining it's default SMB folder (with a unique random name) and then there was the one defined by me. The catch is that defining a shared folder should be done in the docker Vagrantfile and not in the host one, because the host could be used by multiple docker Vagrantfiles (possibly in different projects). This is probably why for SMB vagrant ensures that each mount inside the host VM gets a unique name. Furthermore, in my case passing that shared folder as a volume to the container was already done by vagrant so removing my own volume mapping did the trick. Try playing around with these ideas and see if they work for you. |
Hi there, It looks like this has been resolved within a previously shipped version of Vagrant so I am now closing this issue. If the original issue was not fully resolved, please reopen this issue or create a new one. Cheers! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Vagrant version
Vagrant 1.8.1
Host operating system
win7
Guest operating system
Centos 7
Vagrantfile
host\Vagrantfile
Debug output
https://gist.github.com/AgentCormac/0bde7c685cabcc67fac7f6a5f453ba66
Expected behavior
Postgres database file should be in C:\dev\vagrant\workspace\SpringMVCHibernate\shared-data\mysql\data
Actual behavior
Host
C:\dev\vagrant\workspace\SpringMVCHibernate\shared-data\mysql\data is empty
Dockerhost
/home/vagrant/workspace/shared-data/postgres/data is empty
Container
/var/lib/postgresql/data is empty
Steps to reproduce
vagrant up
The text was updated successfully, but these errors were encountered: