tekton-example-pipeline/tasks/build-task.yaml

39 lines
1.0 KiB
YAML

---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-docker-image
spec:
resources:
inputs:
- name: git-app-repo
type: git
outputs:
- name: image-registry
type: image
params:
- name: pathToDockerFile
description: Path to Dockerfile
default: Dockerfile
- name: pathToContext
description: The build context used by Kaniko
default: /workspace/git-app-repo
# Get our Docker image details from the build-task-configmap configmap
stepTemplate:
envFrom:
- configMapRef:
name: build-task-configmap
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor:v0.10.0
env:
- name: "DOCKER_CONFIG"
value: "/builder/home/.docker/"
command:
- /kaniko/executor
args:
- --dockerfile=$(params.pathToContext)/$(params.pathToDockerFile)
- --destination=$(resources.outputs.image-registry.url)/$(DOCKER_NAMESPACE)/$(DOCKER_IMAGE_NAME):$(DOCKER_TAG)
- --context=$(params.pathToContext)