Code Monkey home page Code Monkey logo

tekton-buildah-docker-build's Introduction

Clone repo, build docker image and push docker image to Docker Hub using Tekton pipeline using Buildah

This is a simple sample project to demonstrate how to clone source from Git repo, build docker image and push that docker image to Docker Hub using Tekton pipeline using Buildah.

Used Tekton resources in this project

Folder Structure

├───app/
│   ├───Dockerfile
│   ├───index.js
│   └───package.json
├───policy/
│   ├───README.md
│   └───trust-policy.json
├───resources/
│   ├───dockerhub-secret.yaml
│   ├───role-binding.yaml
│   ├───role.yaml
│   └───service-account.yaml
└───tekton/
    ├───triggers/
    │   ├───event-listener.yaml
    |   ├───ingress.yaml
    |   ├───rbac.yaml
    |   ├───trigger-template.yaml
    |   └───trigger-binding.yaml
    ├───pipeline-runs/
    │   └───pipeline-run.yaml
    └───pipelines/
        └───pipeline.yaml

Required configuration

All the required configuration is in the resources folder.

  • Create a secret with your Docker Hub credentials
  • Create ServiceAccount with the secret
  • Create Role and RoleBinding to allow the ServiceAccount to create resources in the namespace

You need to apply the above resources before running the pipeline. You use the below command to apply the resources.

kubectl apply -f resources/

Troubleshooting

  • If you get an error like this:

error while running "VolumeBinding" prebind plugin for pod "app": Failed to bind volumes: timed out waiting for the condition

You can follow the steps in the below link to fix it [https://github.com/dinushchathurya/tekton-docker-push/blob/master/policy/README.md]

tekton-buildah-docker-build's People

Contributors

dinushchathurya avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

glaceroy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.