8c34055ea7
This will change to run the prepare step of buildpack as priviledged because it is failing on security constraint platform like OpenShift Fix #197 |
||
---|---|---|
.. | ||
tests | ||
buildpacks-v3.yaml | ||
OWNERS | ||
README.md |
Cloud Native Buildpacks
This build template builds source into a container image using Cloud Native Buildpacks.
The Cloud Native Buildpacks website describes v3 buildpacks as:
... pluggable, modular tools that translate source code into container-ready artifacts such as OCI images. They replace Dockerfiles in the app development lifecycle with a higher level of abstraction. ... Cloud Native Buildpacks embrace modern container standards, such as the OCI image format. They take advantage of the latest capabilities of these standards, such as remote image layer rebasing on Docker API v2 registries.
Install the Task
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/buildpacks/buildpacks-v3.yaml
NOTE: This task is currently only compatible with Tekton v0.6.0 and above, and CNB Platform API 0.2 (lifecycle v0.6.0 and above). For previous Platform API versions, see below.
Inputs
Parameters
-
BUILDER_IMAGE
: The image on which builds will run (must include v3 lifecycle and compatible buildpacks; required) -
USE_CRED_HELPERS
: Use Docker credential helpers. Set to"true"
or"false"
as string a value. (default:"false"
) -
CACHE
: The name of the persistent app cache volume (default: an empty directory -- effectively no cache) -
USER_ID
: The user ID of the builder image user, as a string value (default:"1000"
) -
GROUP_ID
: The group ID of the builder image user, as a string value (default:"1000"
) -
SOURCE_SUBPATH
: A subpath within thesource
input where the source to build is located (default:""
)
Resources
source
: Agit
-typePipelineResource
specifying the location of the source to build. SeeSOURCE_SUBPATH
above if source is located within a subpath of this input.
Outputs
Resources
image
: Animage
-typePipelineResource
specifying the image that should be built.
Usage
This TaskRun
will use the buildpacks-v3
task to fetch source code from a Git repo, build the source code, then publish a container image.
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: example-run
spec:
taskRef:
name: buildpacks-v3
# Uncomment the lines below to use an existing cache
# podTemplate:
# volumes:
# - name: my-cache
# persistentVolumeClaim:
# claimName: task-pv-claim
inputs:
resources:
- name: source
resourceSpec:
type: git
params:
- name: url
value: <your git repo, e.g. "https://github.com/buildpacks/samples">
params:
- name: SOURCE_SUBPATH
value: <optional subpath within your source repo, e.g. "apps/java-maven">
- name: BUILDER_IMAGE
value: <your builder image tag, see below for suggestions, e.g. "builder-repo/builder-image:builder-tag">
# Uncomment the lines below to use an existing cache
# - name: CACHE
# value: my-cache
outputs:
resources:
- name: image
resourceSpec:
type: image
params:
- name: url
value: <your output image tag, e.g. "gcr.io/app-repo/app-image:app-tag">
Example builders
Cloud Foundry:
cloudfoundry/cnb:bionic
cloudfoundry/cnb:cflinuxfs3
Heroku:
heroku/buildpacks:18
Previous Platform API Versions
Use one of the following commands to install a previous version of this task. Be sure to also supply a compatible builder image (BUILDER_IMAGE
input) when running the task (i.e. one that has a lifecycle implementing the expected platform API).
CNB Platform API 0.1
Commit: 5c2ab7d6
kubectl -f https://github.com/tektoncd/catalog/blob/5c2ab7d6c3b2507d43b49577d7f1bee9c49ed8ab/buildpacks/buildpacks-v3.yaml