▶ FIELD MANUAL // TOOLS N TOYS

# DOCKER CHEATSHEET

Comprehensive Command Reference

## Docker Compose

BASH

    docker compose up -d    # Start services in background
    docker compose down     # Stop and remove containers
    docker compose ps       # List status
    docker compose logs -f  # Follow logs
    docker compose pull     # Download latest images

## Container Management

BASH

    docker ps -a            # List all containers
    docker stop name        # Stop container
    docker rm name          # Remove container
    docker exec -it name bash # Shell into container

## Image Management

BASH

    docker images           # List images
    docker rmi image_id     # Remove image
    docker build -t name .  # Build from Dockerfile
    docker pull name:tag    # Pull specific version

## Volumes

    docker volume ls        # List volumes
    docker volume rm name   # Remove volume
    docker volume prune     # Delete unused volumes

## Networks

    docker network ls       # List networks
    docker network inspect name
    docker network create name

## System Cleanup

Pruning is permanent

Use these to reclaim disk space from unused resources.

BASH

    docker system prune     # Clean everything unused
    docker system prune -a  # Including unused images
    docker system df        # Show disk usage

## Troubleshooting

- Permission Denied: `sudo usermod -aG docker $USER`
- Port Conflict: `sudo lsof -i :PORT`
- Daemon Restart: `sudo systemctl restart docker`