update Improving Docker on Mac Speed Docs
This commit is contained in:
parent
6440ca841a
commit
ee481a2a26
51
README.md
51
README.md
@ -1752,39 +1752,56 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ
|
|||||||
"Warning Containers Data might be lost!"
|
"Warning Containers Data might be lost!"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
<a name="Speed-MacOS"></a>
|
<a name="Speed-MacOS"></a>
|
||||||
### Improve speed on MacOS
|
### 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.
|
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)
|
> How to share files using NFS (d4m-nfs)
|
||||||
|
|
||||||
[d4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one.
|
[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.
|
1) Update the Docker [File Sharing] preferences:
|
||||||
2. Restart docker.
|
|
||||||
3. Clone d4m-nfs repository in your home directory
|
Click on the Docker Icon > Preferences > (remove everything form the list except `/tmp`).
|
||||||
```bash
|
|
||||||
$ git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
|
2) Restart Docker.
|
||||||
```
|
|
||||||
4. Edit/create the file ~/d4m-nfs/etc/d4m-nfs-mounts.txt with this configuration:
|
3) Clone the [d4m-nfs](https://github.com/IFSight/d4m-nfs) repository to your `home` directory.
|
||||||
```
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
|
||||||
|
```
|
||||||
|
|
||||||
|
4) Create (or edit) the file `~/d4m-nfs/etc/d4m-nfs-mounts.txt`, and write the follwing configuration in it:
|
||||||
|
|
||||||
|
```txt
|
||||||
/Users:/Users
|
/Users:/Users
|
||||||
/Volumes:/Volumes
|
/Volumes:/Volumes
|
||||||
/private:/private
|
/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
|
5) Create (or edit) the file `/etc/exports`, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the `d4m-nfs.sh` script before).
|
||||||
```bash
|
|
||||||
~/d4m-nfs/d4m-nfs.sh
|
|
||||||
```
|
6) Run the `d4m-nfs.sh` script:
|
||||||
|
|
||||||
That's it! Now you just have to bring your container up with docker compose. For example:
|
```bash
|
||||||
|
~/d4m-nfs/d4m-nfs.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
That's it! Run your containers.. Example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d nginx mysql
|
docker-compose up -d nginx mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note:** If you faced any errors, try restarting Docker, and make sure you have no spaces in the `d4m-nfs-mounts.txt` file, and your `/etc/exports` file is clear.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Common-Problems"></a>
|
<a name="Common-Problems"></a>
|
||||||
|
Loading…
Reference in New Issue
Block a user