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
64 stars 15 forks source link

"You should list commands" #35

Closed psychemedia closed 4 years ago

psychemedia commented 4 years ago

https://github.com/nuest/ten-simple-rules-dockerfiles/blob/4a87e3e3ad43feacd98722f1521e500191bb17bb/ten-simple-rules-dockerfiles.Rmd#L211

For the novice, this my need contextualising. The container is built by executing statements in the Dockerfile in order. When one step is completed, the result is cached, and the build moves to the next step. If you change something in the Dockerfile, and rebuild the container, each statement is inspected in turn. If it hasn't changed, the cached layer is used and the build progresses. If the line has changed, that build step is executed afresh and then every following step will have to be rebuilt in case the line that changed changed something for a following step.