What a container is
A container bundles your application together with its libraries, runtime, and config into a single isolated unit. Unlike a virtual machine, it shares the host operating system kernel, so it starts in milliseconds and uses far less memory.
Docker is the most common tool for building and running containers.
Images and containers
- An image is a read only template built from a Dockerfile. It is layered, so unchanged layers are cached and reused.
- A container is a running instance of an image. Many containers can run from the same image.
Why teams use them
- Portability the same image runs on a laptop, a CI server, and production.
- Consistency it works on my machine becomes it works everywhere.
- Density many containers fit on one host because they are lightweight.
How a build flows
Isolation comes from Linux kernel features such as namespaces and cgroups, which limit what a container can see and how many resources it can use.
Key idea
A container packages an app with its dependencies and shares the host kernel, giving you portable, lightweight, fast starting units of deployment.