328b67800f
Starting from 0.7.0, the later is not supported anymore. Signed-off-by: Vincent Demeester <vdemeest@redhat.com> |
||
---|---|---|
.. | ||
0-buildkitd.yaml | ||
1-task.yaml | ||
README.md |
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
-typePipelineResource
specifying the location of the source to build.
Outputs
Resources
- image: An
image
-typePipelineResource
specifying the image that should be built.