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

[Feature] Need a property to handle default file exclusions while building images #1708

Closed
thuva9872 opened this issue Sep 26, 2023 · 3 comments · Fixed by #1707
Closed

[Feature] Need a property to handle default file exclusions while building images #1708

thuva9872 opened this issue Sep 26, 2023 · 3 comments · Fixed by #1707

Comments

@thuva9872
Copy link
Contributor

Description

The current behavior of the plugin is to build a Docker archive with default exclusion rules, which exclude hidden files. However, the Docker CLI includes hidden files by default.
Currently there is no properties available to disable the default file exclusions. So, we need a new property to handle the behaviour of the plugin.

@thuva9872 thuva9872 changed the title Need a property to handle default file exclusions while building images [Feature] Need a property to handle default file exclusions while building images Sep 26, 2023
@rhuss
Copy link
Collaborator

rhuss commented Sep 27, 2023

Thanks for the report! Actually I consider this is a bug and I think that hidden files should be always included to mimic the Docker behaviour. So I would probably just change this unconditionally, as adding to the configuration should always be considered carefully as we already have tons of configs.

@rohanKanojia wdyt, would it make sense to include hidden files by default ? I know that this is not necessarily backwards compatible, but we could also add a global property that could be set on the Maven property level like useLegacyDockerBuildFileExclusion (but if this I think is not necessary, because adding hidden files does not really harm except for a slighter worse performance and little security concerns).

@thuva9872
Copy link
Contributor Author

Hi @rhuss ,

Your point is well-founded. However, in certain scenarios, there could arise a necessity to disregard hidden files. If there isn't an available option to manage this behavior, it might pose an issue. I believe it would be beneficial to introduce a Maven property at the very least, as you previously suggested. What are your thoughts on this?

Thank you

@rhuss
Copy link
Collaborator

rhuss commented Oct 2, 2023

Ok, then let's keep it as is, and let's don't overdo it. I used to always question changes in the configuration surface, just to be sure that we don't inflate that space with options that could be covered otherwise.

Happy with your PR, and as I see, the default is now to exclude hidden files. Since this is a non-backwards compatible change (which I don't think harms a lot), could you please add an entry to the ChangeLog, to indicate that change ?

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

Successfully merging a pull request may close this issue.

2 participants