buildkit
buildkit copied to clipboard
add an additional --exclude option to COPY instruction for the files or folders to be excluded while copying them
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
Related topics;
- https://github.com/moby/moby/issues/15771
- https://github.com/moby/moby/issues/37333
- https://github.com/moby/buildkit/pull/2082
An attempt to implement this feature (without support of the type flag) can be found at https://github.com/moby/buildkit/pull/4561.