apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: name: debian-kernel-build-git spec: type: git params: - name: revision value: master - name: url value: http://git-ui.lan/chaos/kernel-configs.git --- apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: name: debian-kernel-build-image spec: type: image params: - name: url value: cr.lan/debian-kernel-build-stable --- apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: build-debian-kernel-build-from-source spec: params: - name: pathToContainerFile type: string description: The path to the dockerfile to build default: $(resources.inputs.kernel-configs.path)/Dockerfile - name: pathToContext type: string description: | The build context used by Kaniko (https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts) default: $(resources.inputs.kernel-configs.path) resources: inputs: - name: kernel-configs type: git outputs: - name: kernel-configs-builtImage type: image steps: - name: build-and-push image: gcr.io/kaniko-project/executor:arm64 # specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential env: - name: "DOCKER_CONFIG" value: "/tekton/home/.docker/" command: - /kaniko/executor args: - --dockerfile=$(params.pathToContainerFile) - --destination=$(resources.outputs.kernel-configs-builtImage.url) - --context=$(params.pathToContext) - --skip-tls-verify - name: cleanup-workspace-post image: alpine command: - rm args: - -rf - /workspace/kernel-configs* workspaces: - name: workspace mountPath: /workspace --- apiVersion: tekton.dev/v1beta1 kind: TaskRun metadata: name: build-container-image-from-git-source-task-run spec: #serviceAccountName: dockerhub-service taskRef: name: build-debian-kernel-build-from-source params: - name: pathToContainerFile value: Dockerfile resources: inputs: - name: kernel-configs resourceRef: name: debian-kernel-build-git outputs: - name: kernel-configs-builtImage resourceRef: name: debian-kernel-build-image # workspaces: # - name: workspace # persistentVolumeClaim: # claimName: tektoncd-workspaces # subPath: workspaces