-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
dockerignore documentation unclear/self-contradictory #14308
Comments
Would you be able to make a PR to adjust the documents? |
Wholeheartedly agree with @greaber. I can't get dockerignore to exclude full directories. And the go documentation around |
I think there's actually a PR open that adds a bit more info, will look it up and add a link later |
This (miraculously, but horribly) appears to work!
|
Found the PR; #14095 |
Disclaimer: I am no expert on .dockerignore, so would be good to have extra pairs of eyes to review. @greaber: I had a look at your edits and it is clear to me. I think a slight improvement could be made by splitting up the wildcard and the exclusion sections. ie. Start off with the basics first:
Thoughts? |
@greaber could you create a pull request with your changes; it's easier to review then, and we can discuss the changes on the PR. Thanks in advance! |
#15265. @charleswhchan, I didn't add a second table because I didn't want to make the section any longer than strictly necessary, but the section does discuss the basic case before the negated pattern case. |
@greaber: No worries. Simply a suggestion. |
@greater I still think the most common case is to exclude a directory and all its subdirectories. It would be great to include my hacky workaround in the docs since it's not obvious how to do it. |
@greaber I still think the most common case is to exclude a directory and all its subdirectories. It would be great to include my hacky workaround in the docs since it's not obvious how to do it. |
@lukaso, I'm confused about your example. Either I am not understanding your issue or I am getting different behavior. Is the following session consistent with what you are seeing?
|
|
That looks like it's working properly. In my case the amount of data being transferred was massive, so it might be that the ignore is being done on the docker daemon side? I didn't do the find test. |
The ignore is done on the client side except for the special cases of ignoring Dockerfile and .dockerignore. |
I just tested my hypothesis, but appears to work correctly. Here's my slightly modified test:
The file creation was slow, but it clearly wasn't pushing the 1GB file over to boot2docker. Thanks! |
I'm glad things are working for you now! I'm closing the issue now, but let me know if you have any further thoughts on the docs or see any other anomalies. |
@greaber I just realized my problem is with |
I am confused about how dockerignore works. I think it needs a more formal specification, and/or the examples should get into tricky cases more. Here is a slightly pedantic list of some unclear things in the online documentation:
"Filepaths in .dockerignore are absolute with the current directory as the root." Yet in the example .dockerignore file you give, either all or some of the patterns only match relative paths (depending on whether a leading asterisk can match the empty string). I think what is meant is that filepaths are interpreted relative to the current directory but as if a chroot command had made that directory the root?
"the search is not recursive". What does this mean?
"Globbing (file name expansion) is done using Go’s filepath.Match rules." In the linked documentation, we read that asterisk "matches any sequence of non-Separator characters" (which means characters other than '/'?) and that "Match requires pattern to match all of name, not just a substring". Yet in the example file, you say that the pattern "*.md" will exclude all markdown files. All four of these claims can't be true.
"Formats like [^temp*] are ignored." I don't understand what this means. Is it a qualification of the claim that globbing is done using Go's filepath.Match rules?
The text was updated successfully, but these errors were encountered: