MGT Development Environment - File Sync
File Synchronization on MacOS
To work with a PHP IDE like PhpStorm on your host system, you need to sync your code into the container.
The integrated file sharing solution from docker is very slow and not recommended.
To have a good performance, we need to sync the files from the host system into the container.
For the two way file-synchronization, we use the great tool Unison.
Setup Unison on MacOS
To work with Unison, it's very important to have the right versions installed.
- Download and Install Unison.
Download and install Unison by Drag'n Drop into the Applications folder.
Download Unison- Install the Unison command-line tool.
Click on "Yes" to install the Unison command-line tool.

- Open the terminal and install xcode, pip and macfsevents which are needed for unison-fsmonitor.
- Install the unison-fsmonitor binary:
- Create a sync.sh file for each project you want to sync.
In our example, we want to sync the files from our host system into the container from:
/Users/stefan/PhpstormProjects/magento2.mgt/
to
/home/cloudpanel/htdocs/magento2.mgt
We create the file:
/Users/stefan/PhpstormProjects/magento2.mgt/bin/sync.sh
with the following content:
Permissions
Make sure the file sync.sh is executable.
To make it executable run: chmod 775 sync.sh
- Start file-synchronisation
Enter the password root to start the file-synchronization.
File Synchronization on Linux
With linux, you can mount a directory from your host to the container without setting up two-way sync.
Run the MGT Development Environment Docker Container with a volume.
File Synchronization on Windows
Setup Unison on Windows
To work with Unison, it's very important to have the right versions installed.
- Download and Install OpenSSH.
- Download Unison.
Download Unison and extract files to: C:\Program Files\unison
- Create a file sync.bat for each project you want to sync.
In our example, we want to sync the files from our host system into the container from
C:\Users\stefan\PhpstormProjects\magento2.mgt\
to
/home/cloudpanel/htdocs/magento2.mgt/
For this we create the file:
C:\Users\stefan\PhpstormProjects\magento2.mgt\bin\sync.bat
with the following content:
- Start the file synchronization.
To start the file synchronization open the PowerShell and run sync.bat file
Troubleshooting
If you see the error message "Fatal error: inconsistent state. The archive file is missing on some hosts", do the following:
- Delete unison archives on host system with the following command:
- Delete the unison archive in container:
- Start the sync process again.