Hacker News new | ask | show | jobs
by krisgenre 1903 days ago
Does anyone use docker for full-fledged development on OSX? I am a Linux user and tried setting up a dev environment for my colleagues on OSX but file system I/O was extremely slow and completely unusable.
7 comments

Yep, I use it. There are two tricks to mitigate this:

1. Using a :delegated or :cached flag when using a bind mount can speed it up a bit

2. For folders that need a lot of RW, but don’t need to be shared with the host (think node_modules or sbt cache), I bind a docker volume managed by docker-compose. This makes it extremely fast. Here's an example: https://gist.github.com/kamac/3fbb0548339655d37f3d786de19ae6...

IIRC there are some mount options that might help if you search the docker docs, but for me I just create some local docker volumes to hold my code and mount those instead of mounting host folders. It feels a little weird and unnatural that your code is 'hidden' in docker's volume folder (under /var/lib/docker/volumes) in the VM instead of in a folder on your host machine. But it gets you into more of a mindset that this is just a temporary checkout and the real persistent home for the code is your source repository (github, etc.), so you don't let things linger without being checked into a branch somewhere.
Lots of useful information already have been given, I’d also like to add docker-sync [0] for local development environment.

[0] http://docker-sync.io/

We ran into this as well. The I/O would cripple the system. It seems like if you have a compiled language in which the sources are compiled into a single binary that runs on your Docker VM, things are not so bad, but in an interpreted language with the sources on the host’s disk and the interpreter running on the guest, the VM needs to reach across that host/guest VM boundary all the time. We also tried all the tricks to speed it up, but we ultimately gave up and just used native MacOS processes.
Yes I do. I am trying to develop on OSX since a few days, using Docker. But between the low amount of ram on the laptop and the bad IOs performances I decided to give another try to Github Codespaces and I'm very pleasantly surprised. It feels fast enough and I can switch from computer without thinking about it.
My new company's restrictive software whitelists are making Codespaces a very attractive proposition but lead times for invites have been in the months for some people.
Yes. Check out what ddev is doing, there’s some options for using NFS mounts that are acceptably fast.
Thanks for the tips guys. Will definitely try them out.