Dockerfiles describe how to build docker images
docker build -t tagName .
build an image from the dockerfile in the current folder and call is tagName
Each line make a new image that is used in the subsequent step. So if your program downloads a big file then the next line only uses a small bit of it the image will include the big image. Otherwise, if your program downloaded a big image and used a small bit of it on the same line the image only includes the small bit. Much better
Previous image is not modified. So if there is no change that step is not rerun. Put the parts of the code that change the most at the end of the docker file so you can leverage this feature. Note, if you want to redo an part of the code, where things didn't change, you must tell docker as it will otherwise skip it