Closed peterfication closed 9 years ago
The confusion is that folders aren't synced directly from your host OS (OS X) to the Docker container. There is a middleman: the boot2docker VM, which runs linux. In other words, docker-osx-dev syncs each folder /foo/bar
to the exact same location (/foo/bar
) on the boot2docker VM. That VM, it turn, just uses the normal docker commands to mount that folder to some other path in the container.
Therefore, based on your docker-compose.yml
file, if you're running docker-osx-dev in /Users/username/ruby/rails-project
, it will sync the contents of the rails-project
folder to /Users/username/ruby/rails-project
on the boot2docker VM. That folder will then be mounted into /rails_root
in the docker container.
If things are running slowly, one possibility is that you still have vboxsf shared folders enabled. Did you have boot2docker installed before you started using docker-osx-dev?
Yes I installed it with the installer from the docker website. Then a new VM default
was created. Then I installed docker-osx-dev
which installed another VM boot2docker-vm
.
Should I remove some stuff before installing docker-osx-dev
?
By the way, thanks for the explaining of the insides of docker-osx-dev
!
Hm, the docker-osx-dev install
command should, in theory, check if there are already vboxsf shared folders, and warn you in case there are. Perhaps there was a bug there.
If you have nothing important in your containers, you could try:
boot2docker down
boot2docker delete
Then just run docker-osx-dev
again and it'll recreate the VM without shared folders, resync, and hopefully everything will be fast...
Alright there was a shared folder. The whole /Users
folder was shared in the boot2docker-vm
VM. I don't know how this happened.
Thanks a lot for the hints!
I tried to get docker-osx-dev to work but I had no success.
Dockerfile
docker-compose.yml
If I remove the volumes part in
docker-compose.yml
the server is fast as expected. If I don't remove it, the server is slow as expected. If I rundocker-osx-dev
all the sync stuff is happening. But the server stays slow.I get the following debugging output:
I thought, that
docker-osx-dev
is syncing the local dir with the dir specified indocker-compose.yml
(/rails_root
) or did I get something wrong?If this behaviour is correct I don't know where to look for an error. Might anyone has a hint for me?