Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ohffs's avatar
Level 50

Cache/save Docker image for Laravel CI

I've got a CI setup (via gitlab) which runs inside a docker container - it works fine. But it's a bit slow to build the docker image each time the tests run (by 'slow' I mean 'a couple of minutes', so not exactly the end of the world but just enough to be a bit annoying).

Almost all the stuff I can find online is either 'pull down the base image then run apt-get...' or is an image geared to local dev rather than CI - but what I'd like to do is make my own image which had all of the php extensions, composer etc already installed. Where-as at the moment it pulls down the base image, then runs various commands to build the extensions, add things etc every time the CI is triggered.

Is that kind of thing possible? Basically build the image up until the point it'd be doing the git/composer/phpunit then save it as my own image? It feels like I'm just missing the right keyword in my google searches and all would be revealed... ;-)

0 likes
0 replies

Please or to participate in this conversation.