stack icon indicating copy to clipboard operation
stack copied to clipboard

Possible .dockerignore misconfiguration

Open tomokinakamaru opened this issue 3 months ago • 1 comments

Hello, and thank you for your work on this repository!

As part of my research, I am analyzing how developers configure .dockerignore in popular repositories.

During my analysis, I noticed that /.dockerignore might have been written under the assumption that .dockerignore and .gitignore follow the same pattern semantics, while they actually differ.[^1] In particular, the following pattern drew my attention:

https://github.com/stack-auth/stack-auth/blob/4899632ea4f462acaf908f2543100df0dd8c350e/.dockerignore#L140

According to Docker's specification, this pattern matches __pycache__ only in the top-level directory. (To ignore __pycache__ in any directory, the .dockerignore file needs to list **/__pycache__)

Was this pattern written intentionally? If not, I'd be happy to submit a pull request to adjust it.

And if possible, could you tell me whether you were aware of the difference between .dockerignore and .gitignore? (I would like to know whether the differences are generally well recognized, or if they tend to slip developers' minds.)

Thank you again for maintaining this repository!

[^1]: See .gitignore doc, .dockerignore doc, and a blog post about the differences

tomokinakamaru avatar Oct 06 '25 05:10 tomokinakamaru

You're correct with the documentation, and I would assume that it is expected to catch all of the pycache folders. Thanks for such a detailed comment with documentation links! Good luck on your research!

TheUntraceable avatar Oct 13 '25 10:10 TheUntraceable