The order of instruction on the docker file matters a lot. Each instruction in the docker file is a layer. With the docker, when you are building an image, layers that are cached and not changed will be reused again. So, it is essential to keep the i...