1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-25 06:17:50 +00:00
catalog/buildkit
Vincent Demeester 328b67800f Update templating to use $(…) instead of ${…}
Starting from 0.7.0, the later is not supported anymore.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
2019-09-24 08:36:12 -05:00
..
0-buildkitd.yaml Add BuildKit Task 2019-05-14 13:08:57 -05:00
1-task.yaml Update templating to use $(…) instead of ${…} 2019-09-24 08:36:12 -05:00
README.md Add BuildKit Task 2019-05-14 13:08:57 -05:00

BuildKit

This Task builds source into a container image using Moby BuildKit.

Rootless mode is used by default.

Install the Task

Step 0: Deploy BuildKit daemon

First, you need to deploy BuildKit daemon as follows:

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/buildkit/0-buildkitd.yaml

You can adjust the number of replicas as you like.

The default image is set to moby/buildkit:vX.Y.Z-rootless@sha256:... (see YAML files for the actual revision), but you can also build the image manually as follows:

git clone https://github.com/moby/buildkit.git
cd buildkit
DOCKER_BUILDKIT=1 docker build --target rootless -f hack/dockerfiles/test.buildkit.Dockerfile .

If you are using Debian (not Ubuntu) or Arch Linux kernel on each of kubelet nodes, sudo sh -c "echo 1 > /proc/sys/kernel/unprivileged_userns_clone" is required. On RHEL/CentOS 7, sudo sh -c "echo 28633 > /proc/sys/user/max_user_namespaces" is required.

See the content of 0-buildkitd.yaml for further information about rootless mode.

You can also use "rootful" BuildKit image (moby/buildkit:vX.Y.Z) at your own risk.

Step 1: Install the task

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/buildkit/1-task.yaml

Inputs

Parameters

  • DOCKERFILE: The path to the Dockerfile to execute (default: ./Dockerfile)
  • BUILDKIT_CLIENT_IMAGE: BuildKit client image (default:moby/buildkit:vX.Y.Z@sha256:...)
  • BUILDKIT_DAEMON_ADDRESS: BuildKit daemon address (default:tcp://buildkitd:1234)

Resources

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

Outputs

Resources

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