What is Docker?
Docker is an open-source platform that automates the deployment and management of applications inside containers. It packages software along with its dependencies and environment settings, ensuring consistent behavior across different systems.
 
What is a Container?
A container is a lightweight, isolated execution environment that includes an application and everything it needs to run. It shares the host OS kernel but operates independently, making it fast and resource-efficient.
 
What are the Docker Components?
Docker Engine: Core runtime for building and managing containers.
Docker CLI: Command-line tool to interact with Docker.
Docker Images: Templates used to create containers.
Docker Containers: Running instances of images.
Dockerfile: Instructions to build Docker images.
Docker Hub: Cloud-based registry for sharing images.
Docker Compose: Tool for running multi-container apps.
Docker Daemon: Background service managing containers/images.
- What is Docker Workflow?
 
Write a Dockerfile
Build the image (docker build)
Run a container (docker run)
Test and debug
Push to registry (e.g., Docker Hub)
Deploy to other environments
- What is Container Lifecycle?
 
Created: Container defined but not running.
Running: Container is executing.
Paused: Execution temporarily suspended.
Stopped: Execution halted.
Restarted: Started again after stop/failure.
Removed: Container deleted from system.
- How Container is Powered by Kernel?
Containers use kernel features like: 
Namespaces: Isolate system views (PID, network, mounts, etc.)
Cgroups: Control resource usage (CPU, memory, disk I/O)
These features allow containers to run isolated processes using the host OS kernel without needing a full OS per container.
- 15 Docker Commands to Explore Containers:
 
docker --version → Check Docker version
docker ps → List running containers
docker ps -a → List all containers
docker images → List images
docker pull <image> → Download image
docker run <image> → Run container
docker run -it <image> /bin/bash → Interactive shell
docker exec -it <container_id> /bin/bash → Run command in container
docker logs <container_id> → View logs
docker inspect <container_id> → Container details
docker stop <container_id> → Stop container
docker start <container_id> → Start container
docker restart <container_id> → Restart container
docker rm <container_id> → Remove container
docker stats → Live resource usage