Press enter or click to view image in full size
Cloud Native Buildpacks are a modern way of creating container images without a Dockerfile. They work by inspecting the source code and applying industry best practices in running build scripts for that particular language, then packaging up the build artifacts into an OCI compatible container image. This method is known in the industry as “source to image”.
The main actor in this ecosystem is the buildpack, which is a Docker image that knows how to manage a particular programming language such as Java and Go, a particular framework such as React or Angular, and a particular server software such as nginx and httpd. I recommend going through the tutorials on the buildpacks.io site, particularly “An App’s Brief Journey from Source to Image” and “Buildpack Author’s Guide”.
I intend to write more about how to use buildpacks with different types of languages and frameworks, but in this post I will focus on the nginx buildpack produced by Paketo.
The nginx buildpack offers a neat way of packaging up a directory containing the files you want to serve with nginx, and the nginx.conf configuration file. It supports environment variables in nginx.conf, so you can instrument nginx at run time, for example via a ConfigMap in a Kubernetes environment.