A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings
So containers are a way of packaging software. What makes them special is that when you run a container, you know exactly how it will run - it’s predictable, repeatable and immutable. There are no unexpected errors when you move it to a new machine, or between environments. All of your application’s code, libraries, and dependencies are packed together in the container as an immutable artifact. You can think of running a container like running a virtual machine, without the overhead of spinning up an entire operating system. For this reason, bundling your application in a container vs. a virtual machine will improve startup time significantly.
The above characteristics make containers an awesome tool and essential building block in modern cloud architecture. While the industry pushes towards building microservice architectures, containers help facilitate quick elasticity and separation of concerns. And while some may not yet be building microservices, traditional monoliths can be containerized and reap some of the aforementioned benefits.