1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00
catalog/buildah
2020-01-28 08:22:51 -06:00
..
tests [E2E] Add common function when we are adding a registry to tasks 2019-11-27 04:09:35 -06:00
buildah.yaml Add CONTEXT param to buildah task. 2020-01-28 08:22:51 -06:00
OWNERS Add initial OWNERS to some folders 📄 2019-10-23 04:53:23 -05:00
README.md Add CONTEXT param to buildah task. 2020-01-28 08:22:51 -06: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://raw.githubusercontent.com/tektoncd/catalog/master/buildah/buildah.yaml

Inputs

Parameters

  • BUILDER_IMAGE:: The name of the image containing the Buildah tool. See note below. (default: quay.io/buildah/stable:v1.11.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)

Resources

  • source: A git-type PipelineResource specifying the location of the source to build.

Outputs

Resources

  • image: An image-type PipelineResource specify the image that should be built.

Usage

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

apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  name: buildah-build-my-repo
spec:
  taskRef:
    name: buildah
  inputs:
    resources:
    - name: source
      resourceSpec:
        type: git
        params:
        - name: url
          value: https://github.com/my-user/my-repo
  outputs:
    resources:
    - name: image
      resourceSpec:
        type: image
        params:
        - name: url
          value: gcr.io/my-repo/my-image

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