1. What is Docker?

Docker is a platform for containerization — packaging an application and its dependencies into a portable, lightweight container that runs consistently across environments.

Key Features:


2. Docker Components

  1. Docker Image

  2. Docker Container

  3. Dockerfile

  4. Docker Hub

  5. Volumes

  6. Networks


3. Basic Docker Commands

Command Description
docker --version Check Docker version
docker pull <image> Download an image from Docker Hub
docker build -t <name>:<tag> . Build an image from Dockerfile
docker images List local images
docker ps List running containers
docker ps -a List all containers
docker run -d -p 8080:80 <image> Run container in background, map ports
docker stop <container> Stop a running container
docker rm <container> Remove container
docker rmi <image> Remove image
docker logs <container> View container logs
docker exec -it <container> bash Open interactive shell inside container