buildkit icon indicating copy to clipboard operation
buildkit copied to clipboard

add an additional --exclude option to COPY instruction for the files or folders to be excluded while copying them

Open developer-guy opened this issue 3 years ago • 5 comments

AFAIK, COPY instruction already has support some basic level of regexp to exclude files or folders, but, with this option, we'd enhance this functionality. To be more precise, I'd recommended adding an additional --exclude option to docker/dockerfile frontend to let people specify which files or folders to be excluded while copying them:

COPY --exclude=*.sh,type=file # will exclude files ends with .sh
COPY --exclude=manifests,type=folder # will exclude manifests folder

would it make sense? @crazy-max @dentrax

developer-guy avatar May 09 '22 09:05 developer-guy

Related topics;

  • https://github.com/moby/moby/issues/15771
  • https://github.com/moby/moby/issues/37333
  • https://github.com/moby/buildkit/pull/2082

thaJeztah avatar Feb 10 '23 13:02 thaJeztah

An attempt to implement this feature (without support of the type flag) can be found at https://github.com/moby/buildkit/pull/4561.

leandrosansilva avatar Nov 29 '23 14:11 leandrosansilva