GoogleContainerTools / kaniko

Build Container Images In Kubernetes
Apache License 2.0
14.23k stars 1.4k forks source link

Dockerfile COPY with glob performance #3211

Open rcollette opened 1 week ago

rcollette commented 1 week ago

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