Dockerfile is a text file that contains the instructions needed to create a new container image. Docker engine reads the instructions from top to bottom. It contains a bunch of instructions which informs Docker HOW the Docker image should get built. It is like the script of a movie which contains details on how the movie has to be made.
Docker build is the Docker engine command that consumes a Dockerfile and triggers the image creation process.
A Docker image consists of a collection of files (or layers) that pack together all the necessities—such as dependencies, source code, and libraries—needed to set up a completely functional container environment. Images are stored on a Docker registry, such as the Docker Hub, or on a local registry. It is like the actual movie created from the script and stored in a digital movie library
A Docker container is a running instance of a Docker image. Docker run command is used to convert Docker Image into Docker container. Each container is autonomous and runs in its own isolated environment, ensuring it does not disrupt other running applications or its underlying system.Docker defines several container states, such as created, restarting, running, paused, exited, and dead. Imagine it as each one of you running your own copy of the movie from Netflix.
Thank You !