Refresher on Docker Containers
July 09, 2024
Here's a quick recap on Docker containers and how they work.
- Containers are virtualized instances of operating system kernels.
- Be careful though: Unlike virtual machines, while containers look like separate smaller instances of Linux or Windows, they consume resources like processor time, memory, and disk space directly from their parent host.
- From your computer's perspective, containers look like separate apps running along side other apps.
- If we compare and contrast this approach with something like virtual machines, it's way different. VMs are literally virtual instances of machines (complete with their own virtualized processors, virtualized memory, virtualized hard disks, network card, etc).
- Containers allow you to put the files on your website and the web server like Nginx into a few layers of directories and run your web server in a website as if it were another application on your machine. This way, instead of needing all the resources that you'd need to run an entire virtual machine, you can run your website with much less resources.
- Containers are created and run by things called container runtimes. There are many different runtimes.
- Docker files allow you to write instructions for creating/leveraging abstraction layers. Docker takes most of the lines in these Docker files and compresses them into something called a Docker image. Docker then uses containerd to create containers mounted from the images.
- The beauty behind Docker is that these images can be used on any computer that can run Docker and containerd. It doesn't matter how fast, slow, big or small that computer is, as long as it has Docker and containerd.
Like this article?
0
Posted in: containersdocker