Skip to main content

Command Palette

Search for a command to run...

Day 62: Docker Basics: Understanding Containers, Virtual Machines, Buildah, and Hypervisors

#90daysofdevops

Published
•3 min read
Day 62: Docker Basics: Understanding Containers, Virtual Machines, Buildah, and Hypervisors
V

I'm proficient in a variety of DevOps technologies, including AWS, Linux, Python, Docker, Git/Github, Shell Scripting, Jenkins and Computer Networking. My greatest strength is the ability to learn new things because I believe there is always room for self-development

🚀 Introduction

If you’ve just started your DevOps journey, chances are you’ve heard about Docker and containers. But before we dive deep into Docker, it’s important to understand the key concepts that make containerization possible — containers, virtual machines, buildah, and hypervisors.


🔸Virtual Machines (VMs)

  • A Virtual Machine is like a computer running inside another computer. It has:

  • Its own full operating system (Linux, Windows, etc.)

  • Isolated CPU, RAM, and storage allocation

  • High security because of complete separation

  • How it works: VMs run on top of a physical server with the help of a hypervisor (more on that next). Each VM is completely isolated, which makes it secure but resource-heavy.

  • Drawback: If your app doesn’t use all the resources allocated to the VM, the rest goes to waste.

  • Example: You split a server with 100 GB RAM into four VMs with 25 GB each. If one VM’s app uses only 10 GB, 15 GB is wasted.


🔸Hypervisor

  • A hypervisor is software that allows multiple VMs to run on a single physical machine. It:

  • Divides hardware resources among VMs

  • Runs either directly on hardware (Type 1) or on an existing OS (Type 2)

  • Examples: VMware ESXi, VirtualBox, Microsoft Hyper-V, AWS EC2’s Xen Hypervisor.


🔸Containers

  • Containers are like lightweight virtual machines.

  • They package: Your application, Application dependencies (libraries, runtimes), Minimal system components needed to run

  • But unlike VMs, containers share the host OS kernel instead of having their own full OS.

  • Benefits: Much smaller in size (often in MBs instead of GBs), Start in seconds, Easy to move between environments

  • Drawback: They are less isolated than VMs, so security is slightly weaker.

  • Example: A Node.js container only has Node.js + required packages. It borrows the underlying Linux kernel from the host machine.


🔸Buildah

  • Buildah is a tool to build container images (similar to Docker images) without needing the Docker engine.

  • Why Buildah?

    Docker depends on the Docker Engine — a single point of failure. If it crashes, all containers stop.

    Buildah can build images directly, without a running daemon.

    Works seamlessly with Podman and Kubernetes.

    Supports building both Docker and OCI-compliant images.

Difference from Docker:

  • Docker uses a Dockerfile to build images.

  • Buildah lets you build using shell scripts or commands, giving you more flexibility.


🔸Comparing Containers and Virtual Machines

Containers and virtual machines have similar resource isolation and allocation benefits, but function differently because containers virtualize the operating system instead of hardware. Containers are more portable and efficient.


🚀 In short

  • Hypervisors make virtualization possible by running multiple Virtual Machines on one physical server.

  • Virtual Machines are secure but heavy, often wasting unused resources.

  • Containers are lightweight and portable, making them perfect for modern cloud-native applications.

  • Buildah is a flexible, Docker-alternative tool for building container images.


Thanks for reading to the end; I hope you gained some knowledge.❤️🙌

Linkedln

Twitter

Github

A
Anik Sikder10mo ago

Great breakdown! I really appreciate how you clearly distinguished containers from virtual machines that comparison often confuses beginners. The explanation of hypervisors and their types was a nice touch too, helping to clarify the underlying tech.

Buildah is a tool I don’t see mentioned as often, so it’s awesome to learn about how it differs from Docker and its advantages. I’m curious to try it out in my next container build.

Overall, this post is a solid intro for anyone starting their containerization journey concise but packed with the right details. Looking forward to more deep dives, maybe on orchestration with Kubernetes next!

1
V

Really appreciate your kind words! Happy that the explanation helped clarify those concepts. Buildah is definitely underrated. Right now, I will be focusing more on Docker posts, and once that series is done, I will start covering Kubernetes basics.