Docker Setup Guide
What is Docker?
Docker is a containerization platform that packages your application and all dependencies into a standardized unit called a container. This ensures your app runs the same way everywhere.
Installation Steps
- Download Docker Desktop
- Run the Installer
Double-click the Docker Desktop Installer and follow the wizard
- Enable WSL 2
If prompted, enable Windows Subsystem for Linux 2 (WSL 2) for better performance
- Restart Your Computer
Some configurations may require a restart
- Verify Installation
docker --version docker run hello-world
- Download Docker Desktop for Mac
- Open the DMG File
Drag the Docker icon to the Applications folder
- Launch Docker
Open Applications folder and double-click Docker.app
- Grant Permissions
Enter your Mac password when prompted
- Verify Installation
docker --version docker run hello-world
- Update Package Manager
sudo apt-get update - Install Docker
sudo apt-get install docker.io docker-compose - Add User to Docker Group
sudo usermod -aG docker $USER newgrp docker - Start Docker Service
sudo systemctl start docker sudo systemctl enable docker - Verify Installation
docker --version docker run hello-world
Essential Docker Commands
docker build -t image-name .
Build a Docker image from Dockerfile
docker run -p 8000:8000 image-name
Run a container from an image
docker ps
List running containers
docker logs container-id
View container logs
docker stop container-id
Stop a running container
docker rm container-id
Remove a container