nuest / ten-simple-rules-dockerfiles

Ten Simple Rules for Writing Dockerfiles for Reproducible Data Science
https://doi.org/10.1371/journal.pcbi.1008316
Creative Commons Attribution 4.0 International
61 stars 15 forks source link

comment about rule 4: "Document within the dockerfile" #99

Open sdettmer opened 2 years ago

sdettmer commented 2 years ago

comment about rule 4: "Document within the dockerfile"

Whether to documentation is inside the Dockerfile, a README.txt or a formal document going through processes and ending up as signed PDF does not matter for reproducibility I think.

What is important is, that helpful documentation exists, I think.

vsoch commented 2 years ago

Indeed, although if the documentation is outside the Dockerfile (and then lost) it's not very useful. Given there are projects that just grab/save Dockerfile and not surrounding context, I think Dockerfile comments are fairly important, and external to that a bonus. So they both are important.

sdettmer commented 2 years ago

@vsoch Thank you for your quick reply.

If a project documents everything in mark down files, possibly the documentation of the Dockerfile should be there as well. Also if the Dockerfile is generated automatically, it makes not much sense to have documentation there.

I see another risk that higher concepts are forgotten when documenting in Dockerfile instead of specification (in projects that have such). Often people document in Dockerfile (or other files) only "what happens inside", but not why it is needed, where the outputs go to and so on.

Of course you can always use it wrongly, such as copying a Dockerfile without its README.md :)

Of course I agree that documentation is important, but creating a rule to allow to "just grab/save Dockerfile and not surrounding context" does not sound suited to me.

vsoch commented 2 years ago

Yes, but you are missing the case where an automated tool has scraped a bunch of repos to find the Dockerfile and save them separately, without context (I've done this several times).