Compare commits
2 Commits
c40c5b5a33
...
7d2c192b95
Author | SHA1 | Date | |
---|---|---|---|
7d2c192b95 | |||
a7a29c0201 |
@ -8,17 +8,13 @@ spec:
|
|||||||
- name: DOCKERFILE
|
- name: DOCKERFILE
|
||||||
type: string
|
type: string
|
||||||
description: The path to the dockerfile to build
|
description: The path to the dockerfile to build
|
||||||
default: /Dockerfile
|
default: Dockerfile
|
||||||
- name: CONTEXT
|
- name: CONTEXT
|
||||||
type: string
|
type: string
|
||||||
description: The build context used by Docker.
|
description: The build context used by Docker.
|
||||||
default: ./
|
default: .
|
||||||
- name: IMAGE
|
- name: IMAGE
|
||||||
type: string
|
type: string
|
||||||
description: Name (reference) of the image to build.
|
|
||||||
- name: EXTRA_ARGS
|
|
||||||
type: string
|
|
||||||
default: ""
|
|
||||||
resources:
|
resources:
|
||||||
inputs:
|
inputs:
|
||||||
- name: src
|
- name: src
|
||||||
@ -29,24 +25,35 @@ spec:
|
|||||||
steps:
|
steps:
|
||||||
- name: build-and-push
|
- name: build-and-push
|
||||||
workingDir: /workspace/src
|
workingDir: /workspace/src
|
||||||
image: gcr.io/kaniko-project/executor:latest
|
image: moby/buildkit:latest
|
||||||
env:
|
env:
|
||||||
- name: DOCKER_CONFIG
|
- name: DOCKER_CONFIG
|
||||||
value: /kaniko/.docker
|
value: /root/.docker
|
||||||
command:
|
command:
|
||||||
- /kaniko/executor
|
- sh
|
||||||
- $(params.EXTRA_ARGS)
|
- -c
|
||||||
- --dockerfile=/workspace/src/$(params.DOCKERFILE)
|
- |
|
||||||
- --context=/workspace/src/$(params.CONTEXT)
|
PLATFORMS=$(grep 'PLATFORMS ?= ' Makefile | sed -E 's/^PLATFORMS \?= (.+)$/\1/')
|
||||||
- --destination=$(params.IMAGE)
|
if [ -z $PLATFORMS ]; then
|
||||||
- --oci-layout-path=/workspace/src/image-digest
|
PLATFORMS=linux/amd64
|
||||||
- --digest-file=/tekton/results/IMAGE_DIGEST
|
fi
|
||||||
- --cache=true
|
|
||||||
|
buildctl-daemonless.sh --debug \
|
||||||
|
build \
|
||||||
|
--progress=plain \
|
||||||
|
--frontend=dockerfile.v0 \
|
||||||
|
--opt filename=$(params.DOCKERFILE) \
|
||||||
|
--opt platform=${PLATFORMS} \
|
||||||
|
--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:
|
securityContext:
|
||||||
runAsUser: 0
|
privileged: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: docker-config
|
- name: docker-config
|
||||||
mountPath: /kaniko/.docker/config.json
|
mountPath: /root/.docker/config.json
|
||||||
subPath: config.json
|
subPath: config.json
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker-config
|
- name: docker-config
|
||||||
|
Loading…
Reference in New Issue
Block a user