Containers not only change the way of deploying applications but, they affect the way we develop these apps. Thanks to Docker, we can run a variety of services on our local machines. No need to worry about installing extra apps, libraries, and other dependencies.
Docker for Mac, however, is much slower than it’s on Linux. Docker server uses lots of Linux kernel-specific features, so it’s hard to port it to systems like macOS or Windows. Today’s implementation of a docker server based on virtual machines comes with poor performance if it is not tuned for specific OS.
I’m going to show you how to improve the performance of the application running on Docker For Mac by using NFS volumes.
The larger a project, the harder it is to test the code, and with most of the tests being functional – we have to face the problem: we finalize the task, the user story, or close the entire sprint and we have to wait for the tests for hours. This process can be vastly accelerated, even in legacy applications from the era of the PHP 4.
Above all, it is worth introducing unit tests into the new code – extract dependencies outside the code and test what is actually being developed. The tests are supposed to check our logical code, not the library or ORM. The introduction of unit tests is, however, a long-term step that does not give immediate results, which is why I’d like to show you what can be done on top of that.
Firstly, it must be said that one could write a book about the subject and still barely scratch the surface, so I’ll keep this article very brief and only touch upon the practical aspects based on my own experience – assuming a more difficult scenario, when the project has a lot of tests using the MySQL database.
The “why” part
I am sure that if you’ve not been using docker so far, you’ve heard about docker and most probably you’ve read about it. It’s been a very popular topic for at least few years now. So I assume you have at least some knowledge about it.
I don’t want to describe the architecture of docker. There have been thousands of articles, webinars and screen casts about it.