Docker uses cache to enhance the speed of building the project and other instances. All the commands mentioned in the Docker file are used to build other Docker containers and its outcomes are separately stored in a layer. These layers are built on top of every other layer.

Docker runs the Docker file and makes an effort to execute steps one after the other before the finalization. Developing the Docker images with a Docker file is extremely faster as compared to the provision with ansible. This is possible because of the utilization of Docker cache and supreme based images.

BY Best Interview Question ON 06 Oct 2019