diff --git a/tasks/kaniko.yaml b/tasks/kaniko.yaml new file mode 100644 index 0000000..fd3d9de --- /dev/null +++ b/tasks/kaniko.yaml @@ -0,0 +1,34 @@ +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: kaniko + namespace: tekton-pipelines +spec: + params: + - name: IMAGE + description: Name of the image to build + - name: DOCKERFILE + default: ./Dockerfile + - name: CONTEXT + default: ./ + workspaces: + - name: source + steps: + - name: build-and-push + image: gcr.io/kaniko-project/executor:latest + workingDir: $(workspaces.source.path) + args: + - --dockerfile=$(params.DOCKERFILE) + - --context=$(workspaces.source.path)/$(params.CONTEXT) + - --destination=$(params.IMAGE) + - --digest-file=$(terminations.log.path) + volumeMounts: + - name: docker-config + mountPath: /kaniko/.docker + volumes: + - name: docker-config + secret: + secretName: ghcr-auth + items: + - key: .dockerconfigjson + path: config.json \ No newline at end of file