1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-25 06:17:50 +00:00
catalog/task/buildah/0.1
vinamra28 d65ed39437 Use git-clone 0.7 instead of latest in Tasks' test
With git-clone version 0.8, Task now runs as non-root and with this change I
guess it's not working well with our GKE clusters and tests started
failing in nightly runs.

For now changing the version of git-clone to use 0.7 so that for now CI
is unblocked 😅

Signed-off-by: vinamra28 <jvinamra776@gmail.com>
2022-09-27 15:05:12 +02:00
..
tests Use git-clone 0.7 instead of latest in Tasks' test 2022-09-27 15:05:12 +02:00
buildah.yaml Add linux/amd64 platform annotation to the rest of the tasks 2021-10-29 17:08:38 +01:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

Buildah

This Task builds source into a container image using Project Atomic's Buildah build tool. It uses Buildah's support for building from Dockerfiles, using its buildah bud command. This command executes the directives in the Dockerfile to assemble a container image, then pushes that image to a container registry.

Install the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/buildah/0.1/raw

Parameters

  • IMAGE: The name (reference) of the image to build.
  • BUILDER_IMAGE:: The name of the image containing the Buildah tool. See note below. (default: quay.io/buildah/stable:v1.17.0)
  • DOCKERFILE: The path to the Dockerfile to execute (default: ./Dockerfile)
  • CONTEXT: Path to the directory to use as context (default: .)
  • TLSVERIFY: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) (default: true)
  • FORMAT: The format of the built container, oci or docker (default: oci)
  • BUILD_EXTRA_ARGS: Extra parameters passed for the build command when building images. (default: "")
  • PUSH_EXTRA_ARGS: Extra parameters passed for the push command when pushing images. (default: "")

Workspaces

  • source: A Workspace containing the source to build.

Platforms

The Task can be run on linux/amd64 platform.

Usage

This TaskRun runs the Task to fetch a Git repo, and build and push a container image using Buildah.

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: buildah-build-my-repo
spec:
  taskRef:
    name: buildah
  params:
  - name: IMAGE
    value: gcr.io/my-repo/my-image
  workspaces:
  - name: source
    persistentVolumeClaim:
      claimName: my-source

In this example, the Git repo being built is expected to have a Dockerfile at the root of the repository.