-
Notifications
You must be signed in to change notification settings - Fork 106
dockerignore include / exclude computation doesn't match Docker's #159
Comments
I also noticed when changing "" in the first line to "/" (which you can do in Git to match the beginning of a path) that |
I believe our excludes follow rsync rules, not Docker rules, as they are just set as rsync flags. Out of curiosity, does |
The |
No, that syncs even fewer files:
|
I'd take a stab at this myself, but this appears to be too complicated for me to do quickly in bash. It seems reasonable to write this logic in something other than bash, and call out to it to generate the filter list. For now, the safe solution appears to be to disable automatic exclusions with |
Shouldn't this be labeled a bug rather than an enhancement? docker-osx-dev unexpectedly doesn't sync directories that .dockerignore says to include. It's possible that full parity might not be achievable, but the test case I gave is a relatively basic one that is doable. |
The original excludes behavior was added with the idea of just piggybacking on rsync's exclude behavior. Changing it to match As I'm thinking about @philipn's ideas, I thought I'd mention something: I've tried to limit the functionality in docker-osx-dev, as a) bash is a crappy language for doing anything complicated and b) due to #7, we have no easy way to add automated integration tests for this project. If there is a relatively easy way to implement a better excludes functionality, I'm all for it, as I agree it would be better if we were consistent with |
I encountered a situation where
docker-osx-dev
wasn't syncing / noticing changes to certain files that it should have. Here is a reduced test case..dockerignore
contents:Directory contents:
However, files in
foo/bar
aren't synced / watched:I did confirm using a Dockerfile with a line like "COPY . test/" that Docker's behavior is not to ignore
foo/bar
. The issue above is thatdocker-osx-dev
is adding "bar" as an unrooted exclude pattern rather than a rooted one, and so excluding "bar" when it appears as a subdirectory.This is from the Dockerfile docs here:
The idea to use "*" at the beginning to specify a whitelist is something that the same docs above suggest:
The text was updated successfully, but these errors were encountered: