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

Most upvoted comments

+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.