Adding an additional task
For the build-push
task, you could've tried to use the docker build
task, but the image used relies on binding a socket to the Docker daemon, which might not work in all environments. Instead, you will write your task using the Buildah tool (https://buildah.io/) to build and push the image to a registry. This image does not require access to the Docker daemon and will work in any context.
For this task, you will have three parameters. The name of the image to be built and pushed should be provided, along with the credentials to connect to the appropriate image registry.
This task will also need a workspace that will contain the source code that should be packaged up as an image.
Finally, the task will have a single step to build the image, log in to the registry, and push the image to it. These operations will require privileged access in the container, so you will also need to specify this in the step description.
First, start with a...