Laravel 101: A New Flavor for Ravel!
A sweet, elegant Alpine variant is finally stable for your pipeline.
It’s been 6 months since I release Ravel, a battery-included CI/CD Environment for Laravel.
Things have changed since then. Many updates from the OSS community have made a huge contribution to several libraries and images, making debugging and optimizing much easier.
This particular project, Ravel, unexpectedly really help me in developing CI/CD pipelines for many projects that I develop.
I don’t know why but randomly now I decided to develop and optimize this project again. Yeah, a new idea is sparking.
Why don’t Ravel use Alpine as it’s image base?
A simple-yet-hard-to-answer type of question.
Alpine weighs ridiculously small, compared to the most stable image out there. While I write this post, the latest version of Alpine is sized an average of 3 MB, while Ubuntu is sized an average of 25 MB.
Ubuntu size is more than 8x the size of Alpine.
The reason Alpine Linux is much smaller than Ubuntu is because it has very limited features. Ubuntu is much more stable and production-ready if applied to the system workload. Alpine still needs to be manually tweaked and configured so that it can run stable and smoothly.
Not to mention that applications and libraries in Alpine are not as many as Ubuntu has.
It’s working
Migrating Ravel’s base image to Alpine is a challenge, especially for me.
After days of configuring, build test, and CI/CD workflow test, finally, the Alpine image is working perfectly for the Laravel project. Yay!
I successfully cut the size of Ravel from an average of 310 MB,
To only average 140 MB. It’s less than half of its size!
And magically, it’s achieved with the same features, libraries, versions, and functionalities. But with a much lighter size and better performance. How cool is that?
As you can see in the image above, I also built a multi-architecture image so that you can use it on an Intel-based machine or ARM-based machine.
The smaller the better
Depending on the usage, a small image means a better image.
How so?
- It uses the library efficiently, with minimum bloatware
- Minimum bandwidth is used to pull the image
- Saves build time on your CI/CD Pipeline
- Better performance peak
Based on my personal experience, using the Alpine flavor saves me up to 2 minutes for the CI/CD pipeline build time.
To try this performance, you just need to use Ravel in your CI/CD pipeline.
docker pull ezralazuardy/ravel:8.2-alpine
Ravel is now OSS!
Last but not least, I decided to make this project an Open Source Project.
Ravel is now on GitHub under MIT License.
From now on you can contribute or even open an issue if there’s something wrong with it. Cheers!
Level Up Coding
Thanks for being a part of our community! Before you go:
- 👏 Clap for the story and follow the author 👉
- 📰 View more content in the Level Up Coding publication
- 💰 Free coding interview course ⇒ View Course
- 🧠 AI Tools ⇒ View Now
🔔 Follow us: Twitter | LinkedIn | Newsletter
🚀👉 Join the Level Up talent collective and find an amazing job