-
Notifications
You must be signed in to change notification settings - Fork 289
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
build_from_dir can't find Dockerfile when .dockerignore is "*" #484
Comments
Any possibility this can be addressed? |
Hi guys, is the fix in 1320659 going to be merged? |
This also happens if
But for example the same example works perfectly with |
So far that I know, @ghostsquad didn't open a PR against this repo with that fix. Would be willing to take a look if that happens. |
@tlunter PR submitted. Apparently I wrote the code over a year ago, and forgot to submit a PR. IIRC, I wasn't super confident in my changes, which is why I waited on the PR. I'd love some more eyes on the logic. |
Always exclude Dockerfile and .dockerignore from being ignored. https://docs.docker.com/engine/reference/builder/#dockerignore-file > You can even use the .dockerignore file to exclude the Dockerfile and .dockerignore files. > These files are still sent to the daemon because it needs them to do its job. > But the ADD and COPY instructions do not copy them to the image. resolves upserve#484
This is a strange case maybe, but it's something that works on the command line so I thought it might be considered a bug.
I have a
.dockerignore
file in my project that is just*
to ignore all files (to speed up building the image by not copying everything in the project to docker), and when I try to build my container, I get the error:The problem is, docker-api is reading the
.dockerignore
file when building the tar to send to docker and is building the tar without even theDockerfile
.I've tried adding the newly supported negation syntax to my
Dockerfile
:but this doesn't work either, I still get the error.
Maybe
Dockerfile
should be a special case and always be included?Thanks! I use this library via the Docker chef cookbook every day.
EDIT: I can workaround this problem by just building from the Dockerfile rather than building from the directory.
-Caleb
The text was updated successfully, but these errors were encountered: