apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: kaniko-build-task
spec:
inputs:
resources:
- name: git-repo
type: git
params:
- name: dockerfilePath
type: string
description: Path to the Dockerfile to build
default: /workspace/git-repo/Dockerfile
outputs:
resources:
- name: builtImage
type: image
steps:
- name: load-config
image: ubuntu
script: |
# Load configuration from a file and export as environment variables
source /workspace/git-repo/config.env
- name: kaniko-build
image: gcr.io/kaniko-project/executor:latest
command: ["/kaniko/executor"]
args:
- --dockerfile=${inputs.params.dockerfilePath}
- --context=dir:///workspace/git-repo
- --destination=${outputs.resources.builtImage}
- --build-arg=FOO=${FOO}
Updated August 31, 2026
0
Tekton Task Configuration for Kaniko with Dynamic Arguments
YAML configuration for a Tekton Task that utilizes Kaniko to build Docker images. This setup reads configuration from a source file to dynamically set environment variables, enhancing reusability.
Tags
Comments
Loading comments...