1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-29 06:34:08 +00:00
catalog/task/kaniko/0.2
Yulia Gaponenko f4708d478e Add linux/amd64 platform annotation to the rest of the tasks
At this moment all tasks which can be executed on linux/s390x or
linux/ppc64le are tested and labelled accordingly.
The rest of the tasks can be labelled as `linux/amd64`, which
is default platform and where tasks are already tested via
default PR testing cycle.

Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
2021-10-29 17:08:38 +01:00
..
tests Update kaniko image v1.0.0 -> v1.5.1 2021-03-10 14:47:47 +00:00
kaniko.yaml Add linux/amd64 platform annotation to the rest of the tasks 2021-10-29 17:08:38 +01:00
README.md Add linux/amd64 platform annotation to the rest of the tasks 2021-10-29 17:08:38 +01:00

Kaniko

This Task builds source into a container image using Google's kaniko tool.

kaniko doesn't depend on a Docker daemon and executes each command within a Dockerfile completely in userspace. This enables building container images in environments that can't easily or securely run a Docker daemon, such as a standard Kubernetes cluster.

kaniko is meant to be run as an image, gcr.io/kaniko-project/executor:v1.5.1. This makes it a perfect tool to be part of Tekton.

Install the Task

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/kaniko/0.2/kaniko.yaml

Parameters

  • IMAGE: The name (reference) of the image to build.
  • DOCKERFILE: The path to the Dockerfile to execute (default: ./Dockerfile)
  • CONTEXT: The build context used by Kaniko (default: ./)
  • EXTRA_ARGS: Additional args to pass to the Kaniko executor.
  • BUILDER_IMAGE: The Kaniko executor image to use (default: gcr.io/kaniko-project/executor:v1.5.1)

Workspaces

  • source: A Workspace containing the source to build.

Results

  • IMAGE-DIGEST: The digest of the image just built.

ServiceAccount

kaniko builds an image and pushes it to the destination defined as a parameter. In order to properly authenticate to the remote container registry, it needs to have the proper credentials. This is achieved using a ServiceAccount.

For an example on how to create such a ServiceAccount to push an image to DockerHub, see the Authentication documentation page.

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 Kaniko

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: example-run
spec:
  taskRef:
    name: kaniko
  workspaces:
  - name: source
    persistentVolumeClaim:
      claimName: my-source