Some times your code doesn’t run on your machine due to:

Docker is software that allow developers to run packages into images that runs on containers

Images :

Images are contain of light weight config file that’s describes everything that your app need to run.

Containers:

Unlike virtual machines containers are virtual operating system that configured with just enough to run your app. Because containers are created from images as long as machine can run docker your app will behave the same regardless where it is.

As a result of docker we can build our app quickly, safely and cost effectively.

Why we need container:

1- Isolated Enviroment

2- Quick boot step (starts fastly)

3- Lightweight

Commands:

docker -v