Add support for .dockerignore

Fixes #265.

Implementation is a bit more elaborate than docker's implementation and
matches with the one proposed in dotcloud/docker#6869 to handle permission
issues more nicely.