Using Buildpacks in Tekton Pipelines
Explore how to create Tekton Pipelines that use Cloud Native Buildpacks to compile source code into container images. Understand how to install buildpack tasks and git-clone tasks, configure persistent volume claims, and set up triggers to automate builds from GitHub events. This lesson equips you to integrate secure image building into CI/CD workflows on Kubernetes.
We’ll create a new Pipeline that compiles source code to OCI images using Cloud Native Buildpacks. First, we need a Task that compiles the downloaded source code to an OCI image and then pushes the image to a registry. We’ll install the Task from the Tekton Catalog. Tekton Catalog is a Git repository of community-contributed Tekton entities (Tasks, Pipelines, and so on) ready for use in our Pipelines. We can access Tekton Catalog through a web interface known as Tekton Hub.
Install the buildpacks
We need to first install the buildpacks Task from Tekton Hub by running the command given in the 1_installBuildpack.sh file.
This Task builds source code into a container image. To do this, it uses builders to run buildpacks against our application source. A builder is an image that contains an ordered combination of buildpacks and all the components necessary to execute a build.
The Task expects some required parameters and workspaces and returns the digest of the built image.