carpentries-incubator / docker-introduction

Reproducible Computational Environments using Containers
https://carpentries-incubator.github.io/docker-introduction/
Other
44 stars 48 forks source link

Swapping order for consistency #143

Closed sstevens2 closed 2 years ago

sstevens2 commented 3 years ago

Prepping to teach this tomorrow and noticed that this version of the Dockerfile is in a different order than before. Some might add the COPY line in the middle but think most would add it to the end.

sstevens2 commented 3 years ago

Not sure about best practices but I'd probably usually put the RUN commands before the COPY

sstevens2 commented 2 years ago

From 2021-10-05 Sprint: Update content in PR to include explanation about ordering of commands in Dockerfiles (e.g. include COPY after RUN commands) and how this affects the creation/re-creation of layers when updating/rebuilding images.