Skip to content

Latest commit

 

History

History
57 lines (35 loc) · 3.46 KB

File metadata and controls

57 lines (35 loc) · 3.46 KB

Container-Registry Build Task - deprecated

The ibmcloud cr build command is deprecated.

If you use this icr-cr-build Tekton task, you can migrate to one of the three other Tekton tasks available in the catalog to build container images.

For more information about this replacement, see the IBM Cloud™ Container Registry is Deprecating Container Builds blog post.

Exemple usage

The sample-cr-build sub-directory contains an cr-build EventListener definition that you can include in your tekton pipeline configuration to run an example usage of the icr-cr-build and icr-check-va-scan.

It also contains a cr-build-no-resources EventListener definition which is the providing the same example but without the needs to define PipelineResources for image as it uses the task's parameter image-url to provide the information.

Note: this sample also relies on the clone-repo task to clone the application to containerize.

  1. Create or update a toolchain to include:

    • the git repository that you want to clone, which can be private
    • the repository containing this tekton task
    • a Tekton pipeline definition

    Toolchain overview

  2. Add the definitions:

    • for the git-clone-repo (git path)
    • for this task and the sample (container-registry and container-registry/sample-cr-build paths)

    Tekton pipeline definitions

  3. Add the environment properties:

    • apikey to provide an API key used for the ibmcloud login/access
    • repository to indicate the git repository url to clone (correspoding to the one integrated in the toolchain)
    • image-url to indicate the URL of the image to push to the IBM Cloud Container Registry

    Tekton pipeline environment properties

  4. Create a manual trigger to start the sample listener

    Tekton pipeline sample trigger

  5. Run the pipeline

  6. After the pipeline ran successfully, if you look at the IBM Cloud container registry content referenced within the Image url definition, you will see an image with the expected tags:

    $ ibmcloud cr images --restrict jauninb-tekton
    Listing images...
    
    Repository                                                 Tag                                                     Digest         Namespace        Created       Size    Security status
    de.icr.io/jauninb-tekton/images/built-using-cr-build       1.0.0-9                                                 6ebe29100f2e   jauninb-tekton   1 hour ago    55 MB   No Issues
    de.icr.io/jauninb-tekton/images/built-using-cr-build       1.0.0-master-e8e9fa6b7827d7898d04a218fa69f327db7fc2b4   6ebe29100f2e   jauninb-tekton   1 hour ago    55 MB   No Issues
    de.icr.io/jauninb-tekton/images/built-using-cr-build       latest                                                  6ebe29100f2e   jauninb-tekton   1 hour ago    55 MB   No Issues
    
    OK