Containers

World before containers

Physical Machines

  • 1 Physical Server

  • 1 Host Machine (say some Linux)

  • 3 Applications installed

Limitation:

  • Need of physical server.

  • Version dependency (Host and related apps)

  • Patches ”hopefully” not affecting applications.

  • All apps should work with the same Host OS.


  • 3 physical server

  • 3 Host Machine (diff OS)

  • 3 Applications installed

Limitation:

  • Need of physical server(s).

  • Version dependency (Host and related apps)

  • Patches ”hopefully” not affecting applications.

  • Maintenance of 3 machines.

  • Network all three so they work together.


Virtual Machines

  • Virtual Machines emulate a real computer by virtualizing it to execute applications, running on top of a real computer.

  • To emulate a real computer, virtual machines use a Hypervisor to create a virtual computer.

  • On top of the Hypervisor, we have a Guest OS that is a Virtualized Operating System where we can run isolated applications, called Guest Operating System.

  • Applications that run in Virtual Machines have access to Binaries and Libraries on top of the operating system.

( + ) Full Isolation, Full virtualization

( - ) Too many layers, Heavy-duty servers.

Here comes Containers

Containers are lightweight, portable environments that package an application with everything it needs to run—like code, runtime, libraries, and system tools—ensuring consistency across different environments. They run on the same operating system kernel and isolate applications from each other, which improves security and makes deployments easier.

  • Containers are isolated processes that share resources with their host and, unlike VMs, don't virtualize the hardware and don't need a Guest OS.

  • Containers share resources with other Containers in the same host.

  • This gives more performance than VMs (no separate guest OS).

  • Container Engine in place of Hypervisor.

Pros

  • Isolated Process

  • Mounted Files

  • Lightweight Process

Cons

  • Same Host OS

  • Security

Last updated