3

So I have noticed that on Mac there is a huge problem with sync while developing a PHP app. It can take up to 60 seconds before page loads.

As on Mac, Docker uses additional virtual machine I have used http://docker-sync.io to fix it. But I wonder, are you guys having similar issues? Yesterday I have noticed that there is something called File Sharing in Docker settings img. As I've put my code at /Volumes/Documents/wwwdata should I have to add it also?

1
  • What do you mean by 'sync' ? You could always mount the directory to your container and the 'sync' will be instantaneously.
    – Sergiu
    Oct 1, 2017 at 10:58

1 Answer 1

9

As the author of docker-sync, i might be able to give you an comprehensive answer.

Yet, under macOS, there is no solution with native docker for mac tools, to have a somewhat acceptable development environment - which means, sharing source code into the container - during its lifetime.

The main reasons are, that read and write speed on mounted volumes in docker for mac is extremely slow, see the performance comparison . This said, you could mount a volume using -v or volumes into a normal container, but this will be extremely slow. virtualbox or fusion shares are slow out of the same reasons, OSXFS even right now performs better then those, but still is horrible slow.

Docker-sync tries to detach the slow read/write speed from OSXFS by using unison as sync, not direct mount:

enter image description here

Long story short:

Docker for mac is still (very) slow, this hold even for High Sierra with APFS - unusable for development purposes.

The "folder" you are looking at and named "images" are nothing more then OSXFS based mounts into the hyperkit container, so just what it has been used in the past, you just now can configure other folders to be OSXFS synced and available to be mounted then the default ones. So this will not help you at all either.

To make this answer more balanced towards the general case, you find alternatives to docker-sync here - the amount of alternatives also tells you, that there is ( still ) a huge issue in docker-for-mac, it's not docker-sync made up.

3
  • Is this still the case for the latest version of OS X 10.13.4?
    – SaundersB
    Apr 2, 2018 at 2:29
  • Since macos+docker is unusable for development... what do macos users use for development? are there acceptable alternatives to docker? Do they install natively (no environment isolation)? Something else? Btw, thanks for your work Eugen Mayer... Dec 19, 2018 at 9:23
  • At least we are using D4M with huge stacks of Java, PHP, Node , Ruby every day. most of them with docker-sync. So docker for sure works on macOS but you have to align it, plan your project layout to get all the bits right. Other then that you c an pick Linux and just have not a sinhle issue (with docker at least). We develop on docker only, macOS only. Dec 19, 2018 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.