New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for .dockerignore #265
Comments
@hamiltont Are you using |
Yes, and just running a |
For reference:
|
@hamiltont what are the permission of your |
@hamiltont also, please paste us the output of |
Here you go. It should not be relevant, but my cwd when I call c.build is different from the path I provide to c.build(path=foo).
|
@hamiltont sorry to ask, but are you sure you test the right image ? |
I mentioned above that it works correctly if I run |
I wonder if this tar function is the culprit. Is it successfully including EDIT: Don't think that is it, the |
@hamiltont oh sorry I thought we were in the docker repo, not docker-py :) ping @shin- |
ha ha, I was wondering... I'm thinking the issue is that the client needs to detect .dockerignore, build a list of excludes, and ensure the are not tarred into the context. docker probably does this in go, but docker-py probably needs to be trained to look for a .dockerignore file and react to it. tarfile has a filter option that would do nicely |
Yes, I'm guessing this is implemented on the client side in Go, so it needs to be rewritten in Python. :) |
There's an implementation here: docker/compose#294 |
When a release will be created including this fix ? |
I'm using the Ansible docker module (http://docs.ansible.com/docker_image_module.html) and having the same problem. This fix would be fantastic. |
I'll make it happen this weekend, or Monday at the latest. |
👍 |
Nice!! Thanks @shin! |
docker-py==0.5.0 is now available on pypi, thanks everyone for your patience! |
👍 thanks @shin- |
Thank you @shin!! |
According to https://docs.docker.com/reference/builder/#dockerignore you can have a
.dockerignore
file that prevents items from being ADDed. Mine looks like this:And then in my Dockerfile I have
Unfortunately I still see
/root/mycodes/.git
in my container, which is sad because it's almost 300M. Is there any way to support this?The text was updated successfully, but these errors were encountered: