DOCKER AND VOLUME MOUNTING
At the beginning we were using dinghy with NFS file sharing . The performances weren’t very good and we weren’t achieving native linux perfs but it was quite acceptable.
Then Docker released Docker-For-Mac and we naively switched to the official Docker tool for the Mac OS. Unfortunately we faced a BIG issue with filesystem bind mount : https://github.com/docker/for-mac/issues/77. As we mainly work with PHP projects, especially Symfony or Magento ones, with tens of thousands of PHP files, we were devastated because of the very poor performances …
We ended up with a docker-compose-osx.yml file written to override default config. Example for a Magento 2 :
Our developers are now happy again !
DOCKER AND DISK SPACE
To be fair, not completely happy. Because they are annoyed by another famous “Docker for Mac” issue : https://github.com/docker/for-mac/issues/371. The Docker VM image file ( ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2 ) grows continuously and can reach up to 60Gb of disk space !
When running out of disk space, because of the size of the Docker.qcow2 file, the only reliable solution is to delete this file and start with an empty VM image (stop Docker for Mac, delete the file, then restart Docker for Mac). The drawback is that you loose all your docker images (and your docker volumes), and have to download or create them again.
Docker for Mac released a new VM format : raw. Does it suffer from the same space problem ? We haven’t tested it entierly right now, and in its lastest version, Docker rolled back the raw format to qcow2 because of some instabilities…
DOCKER AND XDEBUG
In order to debug our applications with Xdebug inside our containers, we needed to include this bash file in the docker entrypoint of our php image (for more details, cf Victor’s article) It will allow the IDE (here PHPStorm) to listen and remote debug the php app in the container.
Voir tous nos