Search⌘ K
AI Features

What are Containers?

Explore the concept of Docker containers and how they differ from virtual machines by isolating applications with fewer resources. Understand container isolation, port management, statelessness, and the importance of using volumes for persistent data. This lesson helps you grasp container basics essential for building scalable and manageable Dockerized web applications.

Containers

Recall how you could use a Virtual Machine (VM) to install a web application and its dependencies. VM software such as VMware and VirtualBox are known as hypervisors.

They allow you to create a new virtual machine, then install an appropriate operating system with the required application stack (web server, runtimes, databases, etc.):

Single VM
Multiple VMs

In some cases, it may not be possible to install all applications in a single VM so multiple VMs become necessary.

Each VM is a full OS running on emulated hardware in a host OS with access to resources such as networks via the hypervisor. This is a considerable overhead, especially when a dependency could be tiny.

Docker launches each dependency in a separate container. It helps to think of a container as ...

Multiple Docker containers