Docker
Docker
What is Docker?
Docker is an open-source platform that allows developers to package
applications and their dependencies into lightweight, portable
containers. These containers ensure that applications run consistently
across different environments, from development to production.
1. Docker Engine:
• The core of Docker.
• Consists of daemon(dockerd) that listen for API requests.
• Manages container lifecycle (create,start,stop,delete)
2. Docker Image:
• A blueprint for a container
• Containing the OS, application code, and dependencies.
• Stored in Docker Hub or private registries.
• Created using a Dockerfile
3. Docker Containers:
• A running instance of a Docker image.
• Lightweight & isolated from the host system.
• Runs exactly the same across different machines.
• Can be started, stopped, restarted, or deleted.
https://www.datacamp.com/blog/what-is-a-virtual-machine
VMs borrow resources from the physical computer to generate these
virtual computers. For instance, if a computer has 8 CPUs and 16 GBs of
RAM, we can virtualize an environment with 4 CPUs and 8 GBs of
RAM, split from the physical hardware.
Core Components of a VM
• Host Machine : The physical computer that runs VMs.
• Guest OS : The OS installed inside a VM (e.g., Ubuntu, Windows).
• Hypervisor : Software that creates and manages VMs.
Types of Hypervisors
• Type 1 (Bare Metal) : Runs directly on hardware (e.g., VMware
ESXi, Microsoft Hyper-V).
• Type 2 (Hosted) : Runs on a host OS (e.g., VirtualBox, VMware
Workstation).
&
&
Docker Client:
• CLI or API that allows users to interect with Docker Daemon.
• It acts as a UI for Docker.
• Communicates with dockerd using a REST API, over UNIX sockets or
a network interface
Docker Registry:
• Docker registry stores Docker images
• During docker pull command, docker pulls the required images from
our configured registry.
• During push, docker pushes image to our configured registry
What is Docker Images
Image vs Container
What is Docker Container?
Features:
• A way to package applications with all necessary dependencies
and configuration.
• Portable artifact easily shared and moved around
• Makes development and deployment efficient
Docker Commands
↓