<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Harish I J</title>
    <description>The latest articles on DEV Community by Harish I J (@harishij).</description>
    <link>https://dev.to/harishij</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2914891%2Fc8eced47-6cf2-4d62-b826-bef30e1b63bb.jpg</url>
      <title>DEV Community: Harish I J</title>
      <link>https://dev.to/harishij</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harishij"/>
    <language>en</language>
    <item>
      <title>Docker 101 ft. Avg Web Dev</title>
      <dc:creator>Harish I J</dc:creator>
      <pubDate>Wed, 05 Mar 2025 18:44:43 +0000</pubDate>
      <link>https://dev.to/harishij/docker-101-ft-avg-web-dev-25m7</link>
      <guid>https://dev.to/harishij/docker-101-ft-avg-web-dev-25m7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuyi2lss9stkrjn4eru4u.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuyi2lss9stkrjn4eru4u.jpeg" alt="Image description" width="800" height="620"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Docker is a game-changer for modern application development, offering a lightweight and efficient alternative to traditional virtual machines. This article explores the core differences between Docker containers and hypervisor-based virtualization, while providing a practical guide on how to dockerize and streamline your applications. Whether you're a beginner or an experienced developer, you'll find essential Docker commands and insights to enhance your development workflow.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Docker vs. Traditional Virtualization: Understanding the Differences
&lt;/h2&gt;

&lt;p&gt;Docker has revolutionized application development, deployment, and management through its lightweight, portable containers. While Docker containers share similarities with traditional virtual machines (VMs), they differ fundamentally in their architecture and performance characteristics.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Hypervisor?
&lt;/h2&gt;

&lt;p&gt;A hypervisor is virtualization software that creates and manages virtual machines (VMs). It enables multiple operating systems to run simultaneously on a single physical machine by abstracting hardware resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Types of Hypervisors
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Type 1 (Bare Metal):&lt;/strong&gt; Runs directly on the host hardware without a host operating system. Examples include:

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.vmware.com/products/esxi-and-esx.html" rel="noopener noreferrer"&gt;VMware ESXi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/" rel="noopener noreferrer"&gt;Microsoft Hyper-V&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type 2 (Hosted):&lt;/strong&gt; Runs on a host operating system, providing virtualization capabilities. Examples include:

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.virtualbox.org/" rel="noopener noreferrer"&gt;VirtualBox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.vmware.com/products/workstation-pro.html" rel="noopener noreferrer"&gt;VMware Workstation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Docker vs. Hypervisor-based Virtualization
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Traditional Virtualization (Hypervisor)&lt;/th&gt;
&lt;th&gt;Docker (Container Virtualization)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Virtualization Level&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Hardware-level virtualization&lt;/td&gt;
&lt;td&gt;Operating system-level virtualization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OS Overhead&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Each VM runs a full OS instance&lt;/td&gt;
&lt;td&gt;Shares the host OS kernel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Resource Usage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Higher (due to full OS overhead)&lt;/td&gt;
&lt;td&gt;Lower (lightweight and minimal)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Startup Time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Minutes&lt;/td&gt;
&lt;td&gt;Seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Isolation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Strong (hardware-level)&lt;/td&gt;
&lt;td&gt;Process-level (shares the host kernel)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Slower (due to emulating hardware)&lt;/td&gt;
&lt;td&gt;Faster (directly uses host resources)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Architectural Comparison
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hypervisor-based VM:
  Hardware → Host OS → Hypervisor → Guest OS → App

Docker Container:
  Hardware → Host OS → Docker Engine → Container → App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fairflow.apache.org%2Fdocs%2Fdocker-stack%2F_images%2Fdocker-logo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fairflow.apache.org%2Fdocs%2Fdocker-stack%2F_images%2Fdocker-logo.png" alt="https://airflow.apache.org/docs/docker-stack/_images/docker-logo.png" width="800" height="684"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker's lightweight design enables better performance and faster deployment, though it provides slightly less isolation than VMs.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Docker Overview&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Docker is a platform for building, shipping, and running applications in containers. These containers package applications with their dependencies, ensuring consistent behavior across environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Docker Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Container:&lt;/strong&gt; A lightweight, standalone executable package.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image:&lt;/strong&gt; A read-only blueprint for creating containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dockerfile:&lt;/strong&gt; A script defining how to build Docker images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Registry:&lt;/strong&gt; A storage hub for sharing Docker images (e.g., &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose:&lt;/strong&gt; A tool to manage multi-container applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://docs.docker.com/" rel="noopener noreferrer"&gt;Learn more in the Docker documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Docker
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency:&lt;/strong&gt; Ensures consistent application behavior across environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency:&lt;/strong&gt; Lightweight containers require fewer resources than VMs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portability:&lt;/strong&gt; Works on any system supporting Docker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Easily scales horizontally across multiple systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Isolation:&lt;/strong&gt; Containers operate independently from one another.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Essential Docker Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Run a container&lt;/span&gt;
docker run &lt;span class="o"&gt;[&lt;/span&gt;OPTIONS] IMAGE &lt;span class="o"&gt;[&lt;/span&gt;COMMAND]

&lt;span class="c"&gt;# List running containers&lt;/span&gt;
docker ps

&lt;span class="c"&gt;# List all containers (including stopped ones)&lt;/span&gt;
docker ps &lt;span class="nt"&gt;-a&lt;/span&gt;

&lt;span class="c"&gt;# Build an image from a Dockerfile&lt;/span&gt;
docker build &lt;span class="nt"&gt;-t&lt;/span&gt; image_name:tag &lt;span class="nb"&gt;.&lt;/span&gt;

&lt;span class="c"&gt;# Push an image to a registry&lt;/span&gt;
docker push image_name:tag

&lt;span class="c"&gt;# Pull an image from a registry&lt;/span&gt;
docker pull image_name:tag

&lt;span class="c"&gt;# Run a container in the background&lt;/span&gt;
docker run &lt;span class="nt"&gt;-d&lt;/span&gt; image_name:tag

&lt;span class="c"&gt;# Stop a running container&lt;/span&gt;
docker stop container_id

&lt;span class="c"&gt;# Expose a container's port to the host&lt;/span&gt;
docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; local_port:container_port image_name:tag

&lt;span class="c"&gt;# Remove a container&lt;/span&gt;
docker &lt;span class="nb"&gt;rm &lt;/span&gt;container_id

&lt;span class="c"&gt;# Remove an image&lt;/span&gt;
docker rmi image_name

&lt;span class="c"&gt;# List Docker volumes&lt;/span&gt;
docker volume &lt;span class="nb"&gt;ls&lt;/span&gt;

&lt;span class="c"&gt;# Remove a Docker volume&lt;/span&gt;
docker volume &lt;span class="nb"&gt;rm &lt;/span&gt;volume_name

&lt;span class="c"&gt;# Clean up stopped containers&lt;/span&gt;
docker container prune

&lt;span class="c"&gt;# Log in to Docker Hub&lt;/span&gt;
docker login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a full command reference, check the &lt;a href="https://docs.docker.com/engine/reference/commandline/cli/" rel="noopener noreferrer"&gt;Docker CLI documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Compose
&lt;/h2&gt;

&lt;p&gt;Docker Compose simplifies managing multi-container Docker applications using a &lt;code&gt;compose.yaml&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Initialize Docker in a project&lt;/span&gt;
docker init

&lt;span class="c"&gt;# Start services defined in docker-compose.yaml&lt;/span&gt;
docker compose up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example &lt;code&gt;compose.yaml&lt;/code&gt; configuration for managing volumes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;web&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;node:18&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;.:/app&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/app/node_modules&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Learn more in the &lt;a href="https://docs.docker.com/compose/" rel="noopener noreferrer"&gt;Docker Compose documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Docker Compose Watch
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;docker compose watch&lt;/code&gt; automatically rebuilds and restarts services on code changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Watch for changes and sync them&lt;/span&gt;
docker compose watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explore Docker Compose Watch in the &lt;a href="https://docs.docker.com/compose/watch/" rel="noopener noreferrer"&gt;official guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Scout
&lt;/h2&gt;

&lt;p&gt;Docker Scout enhances container security by scanning for vulnerabilities and providing detailed reports.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vulnerability Scanning:&lt;/strong&gt; Detects security risks in images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SBOM (Software Bill of Materials):&lt;/strong&gt; Lists software components in an image.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Integration:&lt;/strong&gt; Automates security checks in pipelines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policy Enforcement:&lt;/strong&gt; Ensures only secure images are deployed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Docker Scout Commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Scan an image for vulnerabilities&lt;/span&gt;
docker scout cves image_name:tag

&lt;span class="c"&gt;# Generate an SBOM report&lt;/span&gt;
docker scout sbom image_name:tag

&lt;span class="c"&gt;# Compare security between images&lt;/span&gt;
docker scout compare image1:tag1 image2:tag2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Discover more in the &lt;a href="https://docs.docker.com/scout/" rel="noopener noreferrer"&gt;Docker Scout documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker GUI / Desktop App
&lt;/h2&gt;

&lt;p&gt;Docker Desktop is the official graphical user interface for Docker, offering a comprehensive suite of tools for container development and management. It includes:&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Components
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker Engine:&lt;/strong&gt; The container runtime environment that powers everything&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker CLI:&lt;/strong&gt; Command-line interface accessible through an integrated terminal&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Compose:&lt;/strong&gt; Tool for defining and running multi-container applications&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker BuildKit:&lt;/strong&gt; Advanced image building system&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Development Tools
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dashboard:&lt;/strong&gt; Visual interface for managing containers, images, volumes, and networks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dev Environments:&lt;/strong&gt; Create isolated development environments from Git repositories&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Docker Extensions:&lt;/strong&gt; Marketplace for adding new features and integrations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container Terminal:&lt;/strong&gt; Direct access to running containers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Built-in Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kubernetes:&lt;/strong&gt; Single-node Kubernetes cluster for local development&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume Management:&lt;/strong&gt; GUI for creating and managing persistent data volumes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image Management:&lt;/strong&gt; Pull, build, and push container images&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Controls:&lt;/strong&gt; Create and manage container networks&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  System Requirements
&lt;/h3&gt;

&lt;p&gt;For Windows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Windows 10/11 64-bit: Pro, Enterprise, or Education&lt;/li&gt;
&lt;li&gt;WSL 2 backend enabled&lt;/li&gt;
&lt;li&gt;Hardware virtualization support (BIOS-enabled)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For macOS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;macOS 11 or newer (Intel or Apple Silicon)&lt;/li&gt;
&lt;li&gt;At least 4GB RAM (8GB recommended)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Docker Desktop is available for personal use and small business teams. Enterprise licenses are required for larger organizations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Understanding the differences between Docker containers and traditional hypervisor-based virtualization helps you make better architectural decisions. Docker's efficiency, portability, and ease of use make it a powerful tool for modern application development.&lt;/p&gt;

&lt;p&gt;For more detailed information, visit the official &lt;a href="https://docs.docker.com/" rel="noopener noreferrer"&gt;**Docker documentation&lt;/a&gt;.**&lt;/p&gt;




&lt;p&gt;by &lt;strong&gt;Harish I J&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
