julien-duponchelle / docker-osx

Fast and easy installation of Docker on OS X
1.03k stars 70 forks source link

`docker run` slow when sharing large directories via volumes #60

Open jayd3e opened 10 years ago

jayd3e commented 10 years ago

I have a situation where calling docker run -v $(pwd):/app <image> pserve development.ini is really slow, due to the fact that vagrant has to sync a rather large directory at pwd. I've found that changing this line:

config.vm.synced_folder "$(echo ~)", "$(echo ~)", :create => true, mount_options: ["dmode=777,fmode=776"]

To:

config.vm.synced_folder "/Users/jayd3e", "/Users/jayd3e", :nfs => true

Eliminates the problem. Just wanted to get some insight into the options that I removed, and why they are there in the first place.

jayd3e commented 10 years ago

Either way, it's recommended that you use NFS, b/c vagrant slows down as your shared folders become larger. More info can be found here.

freewil commented 10 years ago

:+1: big performance improvement, thanks!

jayd3e commented 10 years ago

No prob. Do you have rights to merge?

freewil commented 10 years ago

nope :crying_cat_face: