Docker for Mac Performance¶
There 2 ways how can improve performance of docker volumes on macOS:
1. User-guided Caching¶
Since Docker for Mac 17.06 there's a new
:cached option available for volumes. You can find more information about this in docker blog.
Replace codebase volume definition of php and nginx/apache services with the option below marked as "User-guided caching".
The core idea of this project is to use an external volume that will sync your files with a file synchronizer tool.
$ gem install docker-sync
docker-sync.ymlfile from the latest stable release
- Uncomment docker-sync volume definition in your compose file
- Replace volumes definition of php and nginx/apache services with the option below marked as "Docker-sync".
- Start docker-sync:
- In a new shell run after you started docker-sync
docker-compose up -d
Now when you change your code on the host machine docker-sync will sync your data to php and nginx/apache containers.
For more information visit docker-sync project page.