From f3339825981a258b485b0a6ee0c5f4652d0fe99d Mon Sep 17 00:00:00 2001 From: Simon Perdrisat Date: Fri, 10 Feb 2017 14:11:24 +0100 Subject: [PATCH] instruction to improve d4m speed (#597) * instruction to improve d4m speed * Move mac speed doc to misc section, remove docker-sync instructions --- README.md | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ca1b4345..64bf4c78 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ LaraDock is configured to run Laravel Apps by default, and it can be modified to - [PHPStorm Debugging Guide](#phpstorm-debugging) - [Keep track of your LaraDock changes](#keep-tracking-LaraDock) - [Upgrading LaraDock](#upgrading-laradock) + - [Improve speed on MacOS](#Speed-MacOS) - [Common Problems](#Common-Problems) - [Related Projects](#related-projects) - [Help & Questions](#Help) @@ -377,10 +378,6 @@ Do the same for each project `project2.conf`, `project3.conf`,... 7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon. - - - - ## Usage @@ -1755,8 +1752,38 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ "Warning Containers Data might be lost!" + +### Improve speed on MacOS +Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container. + +#### How to share files using NFS (d4m-nfs) +[d4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one. + + 1. Update docker File Sharing preferences. You should have only /tmp. + 2. Restart docker. + 3. Clone d4m-nfs repository in your home directory + ```bash + $ git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs + ``` + 4. Edit/create the file ~/d4m-nfs/etc/d4m-nfs-mounts.txt with this configuration: + ``` +/Users:/Users +/Volumes:/Volumes +/private:/private + ``` + 5. Empty the file /etc/exports and clean it up if required (there may be collisions if you come from Vagrant or if you already executed the d4m-nfs.sh script) + 6. Run the d4m-nfs.sh script + ```bash + ~/d4m-nfs/d4m-nfs.sh + ``` + +That's it! Now you just have to bring your container up with docker compose. For example: + +```bash +docker-compose up -d nginx mysql +```