DEV Community

Discussion on: Setting up GitLab’s Continuous Integration with Laravel, PostgreSQL and PHPUnit

Collapse
 
ariera profile image
Alejandro Riera

Hi Greg,

Those are very good questions. I think Docker performs some sort of caching that allows to speed up container creation, but for that to work GitLab's CI should keep your images intact across several runs, and I don't think that the case (based on intuition and the fact that subsequent runs of my CI pipeline take always the same time).

As you pointed, it is indeed possible to create a custom image with the basic dependencies we need and that would definitely speed up the process. I think it is fairly straightforward to publish it to DockerHub and use it in your GitLab CI.

And this has been something I've been thinking about doing already some time. Just to give you an idea: in the project I took this example from the test pipeline takes 5 mins and 10 seconds to complete, but phpunit claims that the test were run in just 12 seconds. I don't work on it quite often, but if I resume active development one day I may look into this and write a new post. But let me know if you do it before :)