Allow exclude section to point at existing ignore file #2265
Open
Description
Description
Most container-based applications already have a .dockerignore, it'd be great to be able to point to one of these files for the exclude section of your project descriptor.
Proposed solution
- Add a file-based reference to the exclude section, something like:
exclude_list = ".dockerignore"
- Potentially add a CLI option
--exclude_list .dockerignore
Either option would read .dockerignore and utilize that as the exclude option for the pack instead of listing them out.
Describe alternatives you've considered
- Open .dockerignore
- Copy entire file contents
- Create project.toml with base spec and an exclude section
- Within the exclude section paste in the lines from your .dockerignore file
- Remove all comments and empty lines
- Quote each line and turn into a proper array of directives so that it looks something like this:
[io.buildpacks]
exclude = [
"/.git/",
".env"
]
- Remember to maintain two ignore/exclude lists, the one in project.toml and the other one in .dockerignore