Please confirm you have...
We can name a dockerfile multiple ways. Usual way is to name it as it is either Dockerfile or dockerfile in this case GitHub recognizes a dockerfile. But it's a usual practice that developers name them with extensions like Dockerfile.dev or Dockerfile.prod or similar to it. In these case GitHub fails to recognize them as Dockerfiles.
All repos using Dockerfiles with extensions.
examples:
https://github.com/kmehant/foundation.mozilla.org/blob/master/dockerfiles/Dockerfile.node
Dockerfile
nothing
@lildude @Alhadis can you please look in to it?
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions.
This is only a smaller part of a larger underlying issue — Linguist has no way of identifying files based upon a common prefix, only a suffix (file extension) or complete filename.
Dockerfiles aren't the only thing affected by this; many Makefiles have suffixes that match their relevant architecture; e.g., Makefile.amd64. I believe we can address this on a broader level if we introduce a new strategy to match prefixes instead of extensions.
Ditto Jenkinsfile.whatever (or Jenkinsfile-whatever).
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions.
Still relevant. See https://twitter.com/brunoborges/status/1175107507909320704 for example.
Adding my vote for this one, as it impacts Jenkins, Docker, Makefile, and probably several others. If adding a more general regexp matching is complicated, we could probably get a lot of value out of simple prefix matching in the same way we do extension matching - e.g. for Groovy it might look like this:
extensions:
- ".groovy"
- ".grt"
- ".gtpl"
- ".gvy"
prefixes:
- "Jenkinsfile."
filenames:
- Jenkinsfile
I've tentatively started work on this in the prefix-strategy branch. You can track my slow and sporadic bursts of progress there. Hopefully I can implement this without messing with the classifier… 😓
Most helpful comment
This is only a smaller part of a larger underlying issue — Linguist has no way of identifying files based upon a common prefix, only a suffix (file extension) or complete filename.
Dockerfiles aren't the only thing affected by this; many Makefiles have suffixes that match their relevant architecture; e.g.,
Makefile.amd64. I believe we can address this on a broader level if we introduce a new strategy to match prefixes instead of extensions.