1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-24 06:15:46 +00:00
catalog/makisu
2019-05-04 06:02:53 -05:00
..
makisu.yaml Add makisu Task 2019-05-04 06:02:53 -05:00
README.md Add makisu Task 2019-05-04 06:02:53 -05:00
registry.yaml Add makisu Task 2019-05-04 06:02:53 -05:00

makisu

This Task builds source into a container image using uber's makisu tool.

Makisu is a fast and flexible Docker image build tool designed for unprivileged containerized environments such as Mesos or Kubernetes.

makisu is meant to be run as an image, gcr.io/makisu-project/makisu. This makes it a perfect tool to be part of a Tekton Task.

Create the registry configuration

makisu uses a registry configuration which should be stored as a secret in Kubernetes. Adjust the registry.yaml in this diretroy to contain your user and password for the Docker hub (or configure a different registry). Keep in mind that the secret must exist in the same namespace as the build runs.:

kubectl --namespace default create secret generic docker-registry-config --from-file=./registry.yaml

Install the Task

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/makisu/makisu.yaml

Inputs

Parameters

  • IMAGE: The Docker image name to apply to the newly built image. (required)
  • CONTEXTPATH: The path to the build context (default: /workspace)
  • PUSH_REGISTRY: The Registry to push the image to (default: index.docker.io)
  • REGISTRY_SECRET: Secret containing information about the used regsitry (default: docker-registry-config)

Resources

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

Usage

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

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

Docker Registry

apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  name: example-run
spec:
  taskRef:
    name: makisu
  inputs:
    params:
    - name: IMAGE
      value: my-project/my-app
    resources:
    - name: source
      resourceSpec:
        type: git
        params:
        - name: url
          value: https://github.com/my-user/my-repo

Other Registries

The PUSH_REGISTRY must match the name of the registry specified in the registry.yaml

apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  name: example-run-gcr
spec:
  taskRef:
    name: makisu
  inputs:
    params:
    - name: IMAGE
      value: my-project/my-app
    - name: PUSH_REGISTRY # must match the registry in the secret
      value: eu.gcr.io
    - name: REGISTRY_SECRET
      value: gcr-registry-config
    resources:
    - name: source
      resourceSpec:
        type: git
        params:
        - name: url
          value: https://github.com/my-user/my-repo