Engineering
How to write a Dockerfile that does not waste your time
To write a Dockerfile that builds fast, order instructions from least to most frequently changing. Copy dependency files before source code so Docker reuses cached layers. Reordering two lines cut rebuild time 81 percent, from 37.4 to 7.1 seconds.