Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
developer-guy opened this issue May 9, 2022 · 2 comments

Comments

@developer-guy
Copy link

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

MaxymVlasov added a commit to antonbabenko/pre-commit-terraform that referenced this issue Apr 21, 2023
There is no posibility to exclude part of "pre-installed" files from
COPY step like moby/buildkit#2853
And copy-paste mostly all `site-packages` without it is not worth it
MaxymVlasov added a commit to antonbabenko/pre-commit-terraform that referenced this issue Apr 21, 2023
…#507)

* Docker doesn't provide possibilities for avoiding trash

There is no possibility to exclude part of the "pre-installed" files from
COPY steps like moby/buildkit#2853
And copy-paste mostly all `site-packages` without it is not worth it
@leandrosansilva
Copy link
Contributor

leandrosansilva commented Nov 29, 2023

An attempt to implement this feature (without support of the type flag) can be found at #4561.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants