Eliminate containers build time
Laravel Docker Course
Author: Emad Zaamout
Tuesday, June 27 2023
Description
Github URL for laravel-docker-nginx-php-fpm-opcache
Hello guys, welcome back.
In this tutorial, were going to learn how to create our own custom docker images. If your using Docker to run your Laravel project, then it should be obvious that building your project locally takes a long time.
Generally, in practise, allot of time and resources is lost waiting for docker builds to complete. If you’re employing a CI/CD pipeline, then you most likely will need to have your containers built many times throughout each cycle of your pipeline.
For example, building containers to run tests as a part of your pull requests actions, or building them for deployment to dev, staging or prod. As a developer, I rebuild my containers many times throughout the day depending on the feature I am working on.
If we add up all this time, then it would be easy to see that we would have lost a massive number of hours and resources throughout the year. This costs you money, and less productivity hours.
To eliminate all your docker container build time, you will need to create custom docker images. This makes it so that instead of having your docker image build every single time, you download a custom preconfigured base image that has all what you need installed and configured.