Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.6 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.6 KB

How to speed up Docker for Mac?

It's a known issue that Docker for Mac is slow when using shared volumes containing a big amount of files, see docker/for-mac#77.

So, some workarounds came like :cached and docker-sync. However it's not totally satisfactory because it's still slow compared to native and docker-sync consumes a lot of resources when syncing.

That being said, there is a good alternative, not to say perfect, which is Mutagen. A benchmark is available here. It's almost as fast as native shared volumes with Linux!

This repository shows a configuration with a simple PHP project (Symfony 5 based on symfony-5-docker) but it can be used for any type of project in any language.

Enjoy!

1. Install Mutagen

brew install mutagen-io/mutagen/mutagen

2. Build the containers

docker-compose -f docker-compose.yml -f docker-compose.mac.yml up -d

3. Synchronise the files

At the project root directory, execute:

mutagen project start

Note

When using a non-root user in the container you can simply add the following in mutagen.yml:

  codebase:
    # ...
    configurationBeta:
      permissions:
        defaultFileMode: 644
        defaultDirectoryMode: 755
        defaultOwner: "myuser"
        defaultGroup: "myuser"