{"id":26053359,"url":"https://github.com/harish-ij/docker101","last_synced_at":"2026-05-25T23:39:52.202Z","repository":{"id":280763210,"uuid":"943083661","full_name":"Harish-IJ/Docker101","owner":"Harish-IJ","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-05T06:30:48.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T07:26:16.626Z","etag":null,"topics":["depl","docker","webdevelopment"],"latest_commit_sha":null,"homepage":"https://harish-ij.notion.site/Docker-101-ft-Avg-Web-Dev-1addf534003480b7b76cfe4c8962e2dc?pvs=4","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Harish-IJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-05T06:23:01.000Z","updated_at":"2025-03-05T06:34:07.000Z","dependencies_parsed_at":"2025-03-05T07:36:38.284Z","dependency_job_id":null,"html_url":"https://github.com/Harish-IJ/Docker101","commit_stats":null,"previous_names":["harish-ij/docker101"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harish-IJ%2FDocker101","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harish-IJ%2FDocker101/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harish-IJ%2FDocker101/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Harish-IJ%2FDocker101/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Harish-IJ","download_url":"https://codeload.github.com/Harish-IJ/Docker101/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242515599,"owners_count":20142056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["depl","docker","webdevelopment"],"created_at":"2025-03-08T07:28:08.515Z","updated_at":"2026-05-25T23:39:52.138Z","avatar_url":"https://github.com/Harish-IJ.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker101 ft. Avg Web Dev\n\n- If you prefer a web article version, visit my [Notion Blog](https://harish-ij.notion.site/Docker-101-ft-Avg-Web-Dev-1addf534003480b7b76cfe4c8962e2dc?pvs=4)\n\n![Docker 101 thumb](https://github.com/user-attachments/assets/07682bc7-8b21-4654-93b6-b1ef899fc9ea)\n\n\n\u003e 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.\n\u003e \n\n# Docker vs. Traditional Virtualization: Understanding the Differences\n\nDocker 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.\n\n## What is a Hypervisor?\n\nA 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.\n\n### Types of Hypervisors\n\n1. **Type 1 (Bare Metal):** Runs directly on the host hardware without a host operating system. Examples include:\n    - [VMware ESXi](https://www.vmware.com/products/esxi-and-esx.html)\n    - [Microsoft Hyper-V](https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/)\n2. **Type 2 (Hosted):** Runs on a host operating system, providing virtualization capabilities. Examples include:\n    - [VirtualBox](https://www.virtualbox.org/)\n    - [VMware Workstation](https://www.vmware.com/products/workstation-pro.html)\n\n## Docker vs. Hypervisor-based Virtualization\n\n| Feature | Traditional Virtualization (Hypervisor) | Docker (Container Virtualization) |\n| --- | --- | --- |\n| **Virtualization Level** | Hardware-level virtualization | Operating system-level virtualization |\n| **OS Overhead** | Each VM runs a full OS instance | Shares the host OS kernel |\n| **Resource Usage** | Higher (due to full OS overhead) | Lower (lightweight and minimal) |\n| **Startup Time** | Minutes | Seconds |\n| **Isolation** | Strong (hardware-level) | Process-level (shares the host kernel) |\n| **Performance** | Slower (due to emulating hardware) | Faster (directly uses host resources) |\n\n### Architectural Comparison\n\n```\nHypervisor-based VM:\n  Hardware → Host OS → Hypervisor → Guest OS → App\n\nDocker Container:\n  Hardware → Host OS → Docker Engine → Container → App\n```\n\n\u003caside\u003e\n**Docker's lightweight design enables better performance and faster deployment, though it provides slightly less isolation than VMs.**\n\u003c/aside\u003e\n\n## **Docker Overview**\n\nDocker is a platform for building, shipping, and running applications in containers. These containers package applications with their dependencies, ensuring consistent behavior across environments.\n\n### Key Docker Concepts\n\n- **Container:** A lightweight, standalone executable package.\n- **Image:** A read-only blueprint for creating containers.\n- **Dockerfile:** A script defining how to build Docker images.\n- **Registry:** A storage hub for sharing Docker images (e.g., [Docker Hub](https://hub.docker.com/)).\n- **Docker Compose:** A tool to manage multi-container applications.\n\n[Learn more in the Docker documentation](https://docs.docker.com/).\n\n## Advantages of Docker\n\n- **Consistency:** Ensures consistent application behavior across environments.\n- **Efficiency:** Lightweight containers require fewer resources than VMs.\n- **Portability:** Works on any system supporting Docker.\n- **Scalability:** Easily scales horizontally across multiple systems.\n- **Isolation:** Containers operate independently from one another.\n\n## Essential Docker Commands\n\n```bash\n# Run a container\ndocker run [OPTIONS] IMAGE [COMMAND]\n\n# List running containers\ndocker ps\n\n# List all containers (including stopped ones)\ndocker ps -a\n\n# Build an image from a Dockerfile\ndocker build -t image_name:tag .\n\n# Push an image to a registry\ndocker push image_name:tag\n\n# Pull an image from a registry\ndocker pull image_name:tag\n\n# Run a container in the background\ndocker run -d image_name:tag\n\n# Stop a running container\ndocker stop container_id\n\n# Expose a container's port to the host\ndocker run -d -p local_port:container_port image_name:tag\n\n# Remove a container\ndocker rm container_id\n\n# Remove an image\ndocker rmi image_name\n\n# List Docker volumes\ndocker volume ls\n\n# Remove a Docker volume\ndocker volume rm volume_name\n\n# Clean up stopped containers\ndocker container prune\n\n# Log in to Docker Hub\ndocker login\n```\n\nFor a full command reference, check the [Docker CLI documentation](https://docs.docker.com/engine/reference/commandline/cli/).\n\n## Docker Compose\n\nDocker Compose simplifies managing multi-container Docker applications using a `compose.yaml` file.\n\n```bash\n# Initialize Docker in a project\ndocker init\n\n# Start services defined in docker-compose.yaml\ndocker compose up\n```\n\nExample `compose.yaml` configuration for managing volumes:\n\n```yaml\nservices:\n  web:\n    image: node:18\n    volumes:\n      - .:/app\n      - /app/node_modules\n```\n\nLearn more in the [Docker Compose documentation](https://docs.docker.com/compose/).\n\n### Docker Compose Watch\n\n`docker compose watch` automatically rebuilds and restarts services on code changes.\n\n```bash\n# Watch for changes and sync them\ndocker compose watch\n```\n\nExplore Docker Compose Watch in the [official guide](https://docs.docker.com/compose/watch/).\n\n## Docker Scout\n\nDocker Scout enhances container security by scanning for vulnerabilities and providing detailed reports.\n\n### Features\n\n- **Vulnerability Scanning:** Detects security risks in images.\n- **SBOM (Software Bill of Materials):** Lists software components in an image.\n- **CI/CD Integration:** Automates security checks in pipelines.\n- **Policy Enforcement:** Ensures only secure images are deployed.\n\n### Docker Scout Commands\n\n```bash\n# Scan an image for vulnerabilities\ndocker scout cves image_name:tag\n\n# Generate an SBOM report\ndocker scout sbom image_name:tag\n\n# Compare security between images\ndocker scout compare image1:tag1 image2:tag2\n```\n\nDiscover more in the [Docker Scout documentation](https://docs.docker.com/scout/).\n\n## Docker GUI / Desktop App\n\nDocker Desktop is the official graphical user interface for Docker, offering a comprehensive suite of tools for container development and management. It includes:\n\n### Core Components\n\n- **Docker Engine:** The container runtime environment that powers everything\n- **Docker CLI:** Command-line interface accessible through an integrated terminal\n- **Docker Compose:** Tool for defining and running multi-container applications\n- **Docker BuildKit:** Advanced image building system\n\n### Development Tools\n\n- **Dashboard:** Visual interface for managing containers, images, volumes, and networks\n- **Dev Environments:** Create isolated development environments from Git repositories\n- **Docker Extensions:** Marketplace for adding new features and integrations\n- **Container Terminal:** Direct access to running containers\n\n### Built-in Features\n\n- **Kubernetes:** Single-node Kubernetes cluster for local development\n- **Volume Management:** GUI for creating and managing persistent data volumes\n- **Image Management:** Pull, build, and push container images\n- **Network Controls:** Create and manage container networks\n\n### System Requirements\n\nFor Windows:\n\n- Windows 10/11 64-bit: Pro, Enterprise, or Education\n- WSL 2 backend enabled\n- Hardware virtualization support (BIOS-enabled)\n\nFor macOS:\n\n- macOS 11 or newer (Intel or Apple Silicon)\n- At least 4GB RAM (8GB recommended)\n\nDocker Desktop is available for personal use and small business teams. Enterprise licenses are required for larger organizations.\n\n## Conclusion\n\nUnderstanding 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.\n\nFor more detailed information, visit the official [**Docker documentation](https://docs.docker.com/).**\n\n---\n\n by **Harish I J**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharish-ij%2Fdocker101","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharish-ij%2Fdocker101","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharish-ij%2Fdocker101/lists"}