kaniko sh: sleep: not found

6/25/2019

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} "
          }
-- magnificence
jenkins-pipeline
kubernetes

2 Answers

6/25/2019

I think you have to specify a shell also,

so for example:

container(name: 'kaniko', shell: '/busybox/sh')
-- S.Spieker
Source: StackOverflow

7/29/2019

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"

-- tdensmore
Source: StackOverflow