Docker image build using kaniko fails (runner system failure_

I’m trying to prove the concept of building a Docker image in Gitlab CI using shared runners, so that I can use it for more complex and specific builds as part of our project. When I run the below CI configuration, I keep getting the below error message and the job marked as failed due to system failure:

ERROR: Job failed (system failure): Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"sh\": executable file not found in $PATH": unknown (exec.go:57:0s)

Here’s the CI Configuration I’m using:

.gitlab-ci.yml

stages:
  - Image Build

basic_image:
    stage: Image Build
    image:
      name: gcr.io/kaniko-project/executor:latest
      entrypoint: [""]
    script:
        - /kaniko/executor --context=$CI_PROJECT_DIR --dockerfile=$CI_PROJECT_DIR/Dockerfile --destination=image --tarPath=$CI_PROJECT_DIR/image.tar --no-push --use-new-run
    artifacts:
      name: basic_image
      paths:
      - image.tar

And the basic Dockerfile:

FROM ubuntu:20.04

RUN apt update

I can run the build using kaniko locally fine using the below command

docker run -v $(pwd):/context gcr.io/kaniko-project/executor:latest --dockerfile=Dockerfile --context=/context --destination=sh_test_image:01.00.00 --tarPath=/context/image.tar --no-push --use-new-run

Where am I going wrong when running this in CI?

Bump… anyone?

found this thread, but also found the instructions on gitlab:

specifically: * The kaniko debug image is recommended (gcr.io/kaniko-project/executor:debug) because it has a shell, and a shell is required for an image to be used with GitLab CI/CD.