1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-12-02 06:52:15 +00:00
catalog/buildpacks
Piyush Garg 8c34055ea7 Run prepare of buildpack as privileged
This will change to run the prepare step of buildpack
as priviledged because it is failing on security constraint
platform like OpenShift

Fix #197
2020-02-28 01:59:44 -06:00
..
tests Add persistent volume claim for cache 2020-02-25 22:20:42 -06:00
buildpacks-v3.yaml Run prepare of buildpack as privileged 2020-02-28 01:59:44 -06:00
OWNERS Add OWNERS file to buildpacks task 2019-11-06 11:45:29 -06:00
README.md Update CNB task to conform to Platform API 0.2 2020-02-13 08:47:57 -06:00

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 the source input where the source to build is located (default: "")

Resources

  • source: A git-type PipelineResource specifying the location of the source to build. See SOURCE_SUBPATH above if source is located within a subpath of this input.

Outputs

Resources

  • image: An image-type PipelineResource 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