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

  1. Download Docker Desktop

    Visit docker.com/products/docker-desktop

  2. Run the Installer

    Double-click the Docker Desktop Installer and follow the wizard

  3. Enable WSL 2

    If prompted, enable Windows Subsystem for Linux 2 (WSL 2) for better performance

  4. Restart Your Computer

    Some configurations may require a restart

  5. Verify Installation
    docker --version
    docker run hello-world
  1. Download Docker Desktop for Mac

    Visit docker.com/products/docker-desktop

  2. Open the DMG File

    Drag the Docker icon to the Applications folder

  3. Launch Docker

    Open Applications folder and double-click Docker.app

  4. Grant Permissions

    Enter your Mac password when prompted

  5. Verify Installation
    docker --version
    docker run hello-world
  1. Update Package Manager
    sudo apt-get update
  2. Install Docker
    sudo apt-get install docker.io docker-compose
  3. Add User to Docker Group
    sudo usermod -aG docker $USER
    newgrp docker
  4. Start Docker Service
    sudo systemctl start docker
    sudo systemctl enable docker
  5. 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