kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Execution takes too long for "Unpacking rootfs as cmd COPY"

Open zhouya2010 opened this issue 1 year ago • 3 comments

Actual behavior Creating a custom kaniko image on k8s using the following Dockerfile when execute "Unpacking rootfs as cmd COPY" takes too long:

Dockerfile:

FROM python:3.8
WORKDIR /app
COPY ./main.py ./main.py
COPY ./requirements.txt ./requirements.txt

RUN pip install --no-cache-dir -r requirements.txt 

CMD python main.py

It took nearly 10 minutes at "Unpacking rootfs as cmd COPY ./main.py ./main.py requires it.":

……
[2024-04-27T16:52:37Z] Building stage 'python:3.8' [idx: '0', base-idx: '-1']
[2024-04-27T16:52:37Z] Unpacking rootfs as cmd COPY ./main.py ./main.py requires it.
[2024-04-27T17:02:07Z] WORKDIR /app
[2024-04-27T17:02:07Z] Cmd: workdir
[2024-04-27T17:02:07Z] Changed working directory to /app
……

Expected behavior should be executed quickly

Additional Information

  • Build Context
      --dockerfile=/kaniko/buildcontext/Dockerfile
      --context=<git_url>
      --destination=<dockerhub>
      --log-timestamp=true
      --skip-tls-verify
    
  • Kaniko Image (bitnami/kaniko:1.22.0)

Triage Notes for the Maintainers

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

zhouya2010 avatar Apr 27 '24 17:04 zhouya2010

Thanks for filing this @zhouya2010. Would you mind elaborating the time took with docker since it is checked off Please check if the build works in docker but not in kaniko

JeromeJu avatar May 01 '24 03:05 JeromeJu

@JeromeJu see #1373

suitedaces avatar Jun 12 '24 17:06 suitedaces

similar issue # 1087

ganarajtejasvi avatar Jun 14 '24 11:06 ganarajtejasvi

In my case, when add file to .dockerignore, if the Dockerfile use this file, it would cause the COPY to get stuck.

For example, when a makefile accidentally appears in the .dockerignore file and make is used in the Dockerfile.

dingdayu avatar Oct 24 '24 06:10 dingdayu