Replace boot2docker with Kitematic (if on Mac)
Recently we had a lot of trouble getting our docker setup running on local developer machines. We had problems like non working volume mounts, self shutting down mysql containers and missing permissions on folders with almost every permission set.
And that was definetly not the goal of using docker.
As it turned out the problems come from the vm of boot2docker. boot2docker is using auto mounted shares on the local mac file system, which is in genaral a nice idea. But at this point the system user ids start to mix up and usual file system permissions do not work properly in all cases. So we had problems with default folder within the containers, which became not writeable e.g. the innodb files of a common mysql container or the cache folders of a Shopware image.
On research we found two alternatives:
- rebuild the boot2docker itself with optimised permission settings
- not using boot2docker at all
Rebuilding the boot2docker was suggested here: https://github.com/docker-library/mysql/issues/44. To make that work you have to resize the vm first. And while waiting on the build I decided to give the second approach a try.
Not using boot2docker at all came out to be easier as expected. Now I just use Kitematic. The original purpose of kitematic was to supply a GUI. But beside this, they are using another vm as docker host, which just works. Within the GUI is a button “DOCKER CLI” to go back to command line. There we can use docker and docker compose like we did before. By docker-machine env dev the ip will come up.
After switching to Kitematic and leaving the boot2docker problems aside, I could go back to work on the setup and the application in minutes.