diff --git a/charts/pipelines-library/templates/tasks/kaniko-eks.yaml b/charts/pipelines-library/templates/tasks/kaniko-eks.yaml index a981bc9e..ebcb4ae1 100644 --- a/charts/pipelines-library/templates/tasks/kaniko-eks.yaml +++ b/charts/pipelines-library/templates/tasks/kaniko-eks.yaml @@ -93,84 +93,3 @@ spec: image="$(params.IMAGE)" echo -n "${image}" | tee "$(results.IMAGE_URL.path)" {{- end }} - -{{- if and (eq .Values.global.platform "kubernetes") (eq .Values.global.dockerRegistry.type "dockerhub") }} -apiVersion: tekton.dev/v1beta1 -kind: Task -metadata: - name: kaniko - labels: - app.kubernetes.io/based-on: "0.6" - {{- include "edp-tekton.labels" . | nindent 4 }} - annotations: - tekton.dev/pipelines.minVersion: "0.17.0" - tekton.dev/categories: Image Build - tekton.dev/tags: image-build - tekton.dev/displayName: "Build and upload container image using Kaniko" - tekton.dev/platforms: "linux/amd64" -spec: - description: >- - This Task builds a simple Dockerfile with kaniko and pushes to a registry. - This Task stores the image name and digest as results, allowing Tekton Chains to pick up - that an image was built & sign it. - params: - - name: IMAGE - description: Name (reference) of the image to build. - - name: IMAGE_TAR - description: Name (reference) of the image tar. - default: "image_tar" - - name: DOCKERFILE - description: Dockerfile name. - default: "Dockerfile" - - name: CONTEXT - description: The build context used by Kaniko. - default: ./ - - name: BUILDER_IMAGE - description: The image on which builds will run - default: {{ .Values.kaniko.image.repository }}:{{ .Values.kaniko.image.tag}}-debug - - name: KANIKO_CACHE_REPO - description: The repo where Kaniko stores cached image layers - default: "" - workspaces: - - name: source - description: Holds the context and Dockerfile - volumes: - - name: dockerconfig - secret: - secretName: kaniko-docker-config - items: - - key: .dockerconfigjson - path: config.json - optional: true - results: - - name: IMAGE_DIGEST - description: Digest of the image just built. - - name: IMAGE_URL - description: URL of the image just built. - steps: - - name: build-and-push - workingDir: $(workspaces.source.path) - image: $(params.BUILDER_IMAGE) - script: | - /kaniko/executor \ - --dockerfile=$(workspaces.source.path)/$(params.DOCKERFILE) \ - --context=$(workspaces.source.path)/$(params.CONTEXT) \ - --destination=$(params.IMAGE) \ - --digest-file=$(results.IMAGE_DIGEST.path) \ - --cache=true \ - --cache-repo=$(params.KANIKO_CACHE_REPO) \ - --tar-path=$(params.IMAGE_TAR).tar - securityContext: - runAsUser: 0 - volumeMounts: - - name: dockerconfig - mountPath: /kaniko/.docker -{{- include "resources" . | nindent 6 }} - - image: alpine:3.18.3 - name: write-url - resources: {} - script: | - set -e - image="$(params.IMAGE)" - echo -n "${image}" | tee "$(results.IMAGE_URL.path)" -{{- end }} \ No newline at end of file