kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

Dockerfile COPY with glob performance

Open rcollette opened this issue 1 year ago • 0 comments

Actual behavior copying files with a glob or * pattern takes much much longer than it does with Docker.

Expected behavior I would expect that the performance would be similar to the time it takes for Docker to perform the same COPY operation.

To Reproduce Create a source directory that has for example a node_modules folder and in the root a package.json and package-lock.json file

Try building with

FROM $REGISTRY_PROXY/node:20.12.2-alpine AS base
WORKDIR /build
COPY package.json package.json
COPY package-lock.json package-lock.json

Vs

FROM $REGISTRY_PROXY/node:20.12.2-alpine AS base
WORKDIR /build
COPY package*.json ./

The second form takes much much longer.

Additional Information

  • Kaniko Image (fully qualified with digest) gcr.io/kaniko-project/executor:v1.23.1-debug

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
  • - [X]
Please check if this error is seen when you use --cache flag
  • - [X]
Please check if your dockerfile is a multistage dockerfile
  • - [ ]

rcollette avatar Jun 17 '24 17:06 rcollette