moby: .dockerignore should a support including ignored content
If the only thing you want in your dockerfile is the Gemfile of a project it is tedious to use .dockerignore to exclude everything manually.
With .gitignore there is support for including things allowing you to do:
/*
!/Gemfile
!/Gemfile.lock
Having similar for dockerignore would be very nice.
more background: http://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 1
- Comments: 19 (8 by maintainers)
Commits related to this issue
- .dockerignore ignore support. Fixes #9171 Allow ignoring files from .dockerignore exclude lists like .gitingore by prefixing `!` to a rule. Signed-Off: omeid <public@omeid.me> Signed-off-by: omeid <... — committed to omeid/docker by omeid 9 years ago
- .dockerignore ignore support. Closes #9171 Signed-off-by: omeid <public@omeid.me> — committed to omeid/docker by omeid 9 years ago
+1 on making
.dockerignore
act the same as.gitignore
. After all, I think this is what people expect?@wyaeld I basically just want a docker image with all the dependencies fetched and configured.
The actual content of the project I mount as a volume and no need to have the docker image contain this content as duplicated.