Fix for issue with addFile on a directory

This is mostly supposed to be the fix for https://github.com/Transmode/gradle-docker/issues/16 however since my previous pull hasn't be merged yet it has those changes too.

Not sure what the expected process is here.  I have the access needed to do the merge, but figured it should be reviewed by someone first.  Let me know how you'd like me to proceed.  Thanks.