Custom containers for development

project-thumbnail-20
Developed for SIA "Autentica" in 2021
Tags: GitLab GitLab CI Sonatype Nexus Containers Docker DevOps

I setup an entire pipeline to build and store all of the containers needed for development on-prem.

More information

Have you ever needed to build and store your own containers that aren't necessarily for public consumption? Do you need to avoid running into Docker Hub rate limits and not create unnecessary load on their servers? Do you want good performance while building your own containers, as well as to take advantage of layer reuse? This is exactly what I did for a few projects in the org.

What I did

I setup pipelines and configured Nexus for building and storing lots of custom container images. It handled more or less anything that was needed, be it a Docker image for building other images, a base image (such as Alpine, Debian, Ubuntu, CentOS etc.), as well as any images with additional software that might be needed, such as Node.js or JDK, or .NET, or Python and so on.

Of course, sometimes you'll want to scan your container images, which I achieved with the likes of Trivy, an interesting open source project which is sure to at least slightly improve the security of whatever you want to ship, by scanning it for vulnerabilities to fix ahead of time!

What I learnt

Overall, this was a good experience, that motivated me to go a step further in my personal life - now all of my container images are built on Ubuntu, even if that wasn't the case in the org. You see, there's actually a lot of benefit of knowing exactly how your containers will be built and how you'd install the software in a "regular" distribution, instead of just adding pre-built ELF files, like some of the popular common images seem to do.

Plus, there were really noticeable performance improvements, when you can turn to a server in your personal (or company) servers for downloads, to the point where suddenly builds took just a few minutes, or even less because of caching and multi-stage builds.

Page rendered in: 0.02 seconds