kaniko: build hanging at 'Unpacking rootfs as cmd RUN mkdir ... requires it'

Actual behavior

When using gcr.io/kaniko-project/executor:debug and
running /kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile --destination ${CONTAINER_IMAGE} in gitlab runner build hangs.

Expected behavior

Build finishes successfully and image getting published to gcr

To Reproduce Steps to reproduce the behavior:

Dockerfile

FROM gcr.io/deeplearning-platform-release/tf2-cpu.2-1
RUN mkdir /tpu
COPY test.py /tpu/

.gitlab-ci.yml

stages:
  - publish

variables:
  CONTAINER_IMAGE: gcr.io/${GOOGLE_PROJECT_ID}/${CI_PROJECT_NAME}:${CI_COMMIT_SHORT_SHA}

publish:
  stage: publish
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile Dockerfile --destination ${CONTAINER_IMAGE} --verbosity=debug
    
# Custom Functions -------------------------------------------------------
.custom_functions: &custom_functions |

  function config_kubernetes() {
    kubectl config set-cluster $KUBE_NAME --server="$KUBE_URL" --insecure-skip-tls-verify=true
    kubectl config set-credentials cluster-admin --username="$KUBE_USER" --password="$KUBE_PASSWORD"
    kubectl config set-context default --cluster=$KUBE_NAME --user=cluster-admin
    kubectl config use-context default
    echo $GOOGLE_SERVICE_JSON > ./gcloud-service-key.json
    kubectl create secret generic kaniko-secret --from-file=./gcloud-service-key.json
  }
  
before_script:
  - *custom_functions

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
  • - [ ]
Please check if the build works in docker but not in kaniko
  • - [ ]
Please check if this error is seen when you use --cache flag
  • - [ ]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 3
  • Comments: 23 (2 by maintainers)

Most upvoted comments

Same here:

  • kaniko image version: gcr.io/kaniko-project/executor:v1.12.0-debug
  • env: GitLab CI
  • Base image: amazonlinux:2022
  • command:
/kaniko/executor --cleanup --build-arg FROM_TAG=2.10.5 --build-arg TAG=2.10.5 --custom-platform=linux/amd64 --context=/builds/common/[MASKED]/dockerfiles --dockerfile=external/devonlab/jjobs/Dockerfile --destination=${DESTINATION}
  • Dockerfile:
COPY assets/certs/ /etc/pki/ca-trust/source/anchors/
  • Time: Approximately 30 minutes

getting same issue with confluentinc/cp-kafka-connect-base:7.2.0 on 3rd run