I have tried to build images on my k8s cluster using kaniko,i got this:
sh: touch: not found
sh: sleep: not found
container("kaniko") {
sh "kaniko -f `pwd`/Dockerfile -c `pwd` --destination=${ORIGIN_REPO}/${REPO}:${IMAGE_TAG} "
}
I think you have to specify a shell also,
so for example:
container(name: 'kaniko', shell: '/busybox/sh')
From the Kaniko documentation:
"The kaniko executor image is based off of scratch and doesn't contain a shell. We provide gcr.io/kaniko-project/executor:debug, a debug image which consists of the kaniko executor image along with a busybox shell to enter.
You can launch the debug image with a shell entrypoint:
docker run -it --entrypoint=/busybox/sh gcr.io/kaniko-project/executor:debug"