Docker is a tool that lets you package an application along with everything it needs (code, libraries, settings, runtime) into one unit called a container.
Docker = "Pack once, run anywhere"
The classic situation:
Common reasons:
This is the famous "It works on my machine" problem.
Docker puts everything needed inside a container: