From a7a29c020121fdd6e12f4bc1401823502564e25e Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Fri, 11 Sep 2020 20:56:46 +0100 Subject: [PATCH] Added multi-arch support --- tekton/tasks/docker-build-and-publish.yaml | 43 +++++++++++++--------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/tekton/tasks/docker-build-and-publish.yaml b/tekton/tasks/docker-build-and-publish.yaml index 2345ae9..e40008f 100644 --- a/tekton/tasks/docker-build-and-publish.yaml +++ b/tekton/tasks/docker-build-and-publish.yaml @@ -8,17 +8,13 @@ spec: - name: DOCKERFILE type: string description: The path to the dockerfile to build - default: /Dockerfile + default: Dockerfile - name: CONTEXT type: string description: The build context used by Docker. - default: ./ + default: . - name: IMAGE type: string - description: Name (reference) of the image to build. - - name: EXTRA_ARGS - type: string - default: "" resources: inputs: - name: src @@ -29,24 +25,35 @@ spec: steps: - name: build-and-push workingDir: /workspace/src - image: gcr.io/kaniko-project/executor:latest + image: moby/buildkit:latest env: - name: DOCKER_CONFIG - value: /kaniko/.docker + value: /root/.docker command: - - /kaniko/executor - - $(params.EXTRA_ARGS) - - --dockerfile=/workspace/src/$(params.DOCKERFILE) - - --context=/workspace/src/$(params.CONTEXT) - - --destination=$(params.IMAGE) - - --oci-layout-path=/workspace/src/image-digest - - --digest-file=/tekton/results/IMAGE_DIGEST - - --cache=true + - buildctl-daemonless.sh + - --debug + - build + - --progress=plain + - --frontend=dockerfile.v0 + - --opt + - filename=$(params.DOCKERFILE) + - --opt + - platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + - --local + - context=$(params.CONTEXT) + - --local + - dockerfile=. + - --output + - type=image,name=$(params.IMAGE),push=true + - --export-cache + - type=inline + - --import-cache + - type=registry,ref=$(params.IMAGE) securityContext: - runAsUser: 0 + privileged: true volumeMounts: - name: docker-config - mountPath: /kaniko/.docker/config.json + mountPath: /root/.docker/config.json subPath: config.json volumes: - name: docker-config