Skip to content

tmessini/docky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docky 🐳

Modern Docker and Kubernetes Management System

Python 3.11+ License

Docky is a powerful, modern CLI tool for managing Docker containers, Docker Compose applications, and Kubernetes deployments. Built with Python 3.11+, featuring a beautiful terminal interface powered by Rich and Typer.

✨ Features

🐳 Docker Management

  • Cluster Orchestration: Create and manage clusters of Docker containers
  • Real-time Monitoring: Live resource statistics (CPU, memory, network, disk I/O)
  • Log Aggregation: Consolidated logging from multiple containers
  • Dynamic Scaling: Scale clusters up or down on demand

📦 Docker Compose Support

  • Multi-service Management: Deploy complex applications with a single command
  • Service Scaling: Scale individual services independently
  • Log Streaming: Real-time logs from compose services
  • Health Checks: Built-in service health monitoring

☸️ Kubernetes Integration

  • Deployment Management: Create, scale, and delete K8s deployments
  • Multi-namespace Support: Manage resources across namespaces
  • Log Access: Stream logs from pods and deployments
  • Status Monitoring: Track deployment health and replica status

🎨 Modern CLI Experience

  • Beautiful Terminal UI: Rich tables, progress bars, and color-coded output
  • Intuitive Commands: Simple, memorable command structure
  • Tab Completion: Bash/Zsh/Fish shell completion
  • Live Updates: Real-time feedback with spinners and progress indicators

🚀 Quick Start

Installation

From Source

# Clone the repository
git clone https://github.com/tmessinis/docky.git
cd docky

# Install with Poetry (recommended)
pip install poetry
poetry install
poetry shell

# Or with pip
pip install -e .

Using pip (once published)

pip install docky

Prerequisites

  • Python 3.11+
  • Docker installed and running
  • Docker Compose (for compose commands)
  • kubectl configured (for Kubernetes commands)

First Steps

# Check system health
docky health

# Get help
docky --help

# Version info
docky version

📖 Usage

Docker Cluster Management

Create a Cluster

# Create a simple cluster
docky cluster create my-web-cluster --image nginx:alpine --replicas 5

# Create with custom settings
docky cluster create api-cluster \
  --image myapp:latest \
  --replicas 10

List Clusters

docky cluster list

Scale a Cluster

# Scale up
docky cluster scale my-web-cluster --replicas 20

# Scale down
docky cluster scale my-web-cluster --replicas 2

View Logs

# Get recent logs
docky cluster logs my-web-cluster --tail 100

# Follow logs in real-time
docky cluster logs my-web-cluster --follow

Stop a Cluster

# Stop and remove containers
docky cluster stop my-web-cluster

# Stop but keep containers
docky cluster stop my-web-cluster --no-remove

Docker Compose

Start Services

# Start all services
docky compose up

# Start with custom file
docky compose up --file path/to/docker-compose.yml

# Build images before starting
docky compose up --build

# Custom project name
docky compose up --project my-project

List Containers

docky compose ps

View Logs

# All services
docky compose logs

# Specific service
docky compose logs --service api

# Follow logs
docky compose logs --follow

Stop Services

# Stop and remove
docky compose down

# Remove volumes too
docky compose down --volumes

Kubernetes Management

Create Deployment

# Simple deployment
docky k8s deploy my-app \
  --image nginx:alpine \
  --replicas 3 \
  --port 80

# With custom namespace
docky k8s deploy my-app \
  --image myapp:latest \
  --replicas 5 \
  --namespace production \
  --port 8080

List Deployments

# Default namespace
docky k8s list

# Specific namespace
docky k8s list --namespace production

Scale Deployment

docky k8s scale my-app --replicas 10 --namespace production

View Logs

# Get logs
docky k8s logs my-app

# Follow logs
docky k8s logs my-app --follow --namespace production

Delete Deployment

docky k8s delete my-app --namespace production

Monitoring

Resource Statistics

# View cluster stats
docky monitor stats my-web-cluster

# Continuous monitoring
watch -n 2 docky monitor stats my-web-cluster

Output includes:

  • CPU usage per container
  • Memory usage and limits
  • Network I/O (RX/TX)
  • Block I/O (Read/Write)
  • Process count

📁 Examples

Check out the examples/ directory for exciting use cases:

🎯 Basic Examples

  • Simple Docker Cluster: Quick start with nginx
  • Docker Compose Stack: Multi-service application
  • Kubernetes Deployment: K8s basics

🏗️ Advanced Examples

See examples/README.md for detailed tutorials.

🎨 Beautiful CLI Output

Docky provides a modern, colorful terminal experience:

╭──────────────── Docker Clusters ────────────────╮
│ Cluster Name      Status      Containers       │
├──────────────────────────────────────────────────┤
│ my-web-cluster   RUNNING            5          │
│ api-cluster      RUNNING           10          │
│ test-cluster     STOPPED            0          │
╰──────────────────────────────────────────────────╯

🔧 Configuration

Create a .env file in your project root:

# Docker Settings
DOCKY_DOCKER_SOCKET=unix:///var/run/docker.sock

# Kubernetes Settings
DOCKY_KUBERNETES_NAMESPACE=default
# DOCKY_KUBECONFIG_PATH=~/.kube/config

# Data Storage
# DOCKY_DATA_DIR=~/.docky

See .env.example for all options.

📊 Architecture

┌─────────────────────────────────────────┐
│          CLI (Typer + Rich)             │
├─────────────────────────────────────────┤
│                                         │
│  ┌──────────┐  ┌──────────┐  ┌──────┐ │
│  │  Docker  │  │ Compose  │  │  K8s │ │
│  │ Provider │  │ Provider │  │ Prov │ │
│  └──────────┘  └──────────┘  └──────┘ │
│                                         │
├─────────────────────────────────────────┤
│         Configuration Manager           │
└─────────────────────────────────────────┘

Tech Stack

  • CLI Framework: Typer (modern CLI framework)
  • Terminal UI: Rich (beautiful terminal formatting)
  • Docker SDK: Official Python Docker SDK
  • Kubernetes: Official Python Kubernetes client
  • Configuration: Pydantic (data validation)
  • Storage: JSON-based persistence

🛠️ Development

Setup Development Environment

# Clone repository
git clone https://github.com/tmessinis/docky.git
cd docky

# Install dependencies
poetry install

# Activate virtual environment
poetry shell

# Run tests
pytest

# Format code
black src/
ruff check src/

Project Structure

docky/
├── src/docky/
│   ├── cli.py              # CLI entry point
│   ├── models.py           # Pydantic models
│   ├── config.py           # Configuration management
│   ├── providers/          # Provider implementations
│   │   ├── docker_provider.py
│   │   ├── compose_provider.py
│   │   └── kubernetes_provider.py
│   ├── core/               # Core functionality
│   └── utils/              # Utility functions
├── examples/               # Example configurations
├── tests/                  # Test suite
├── pyproject.toml          # Project dependencies
└── README.md

🎯 Roadmap

Version 2.0 (Current)

  • Modern Python 3.11+ codebase
  • Docker cluster management
  • Docker Compose support
  • Kubernetes integration
  • Real-time monitoring
  • Beautiful CLI with Rich
  • Configuration management

Version 2.1 (Planned)

  • Interactive TUI with Textual
  • REST API with FastAPI
  • WebSocket for live updates
  • Multi-cloud support (AWS ECS, Azure ACI)
  • Advanced health checks
  • Automated rollbacks

Version 3.0 (Future)

  • Web dashboard (React)
  • GitOps integration
  • Cost optimization features
  • AI-powered recommendations
  • Plugin system
  • Service mesh support

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Original delivery-tool by @tmessinis
  • Built with Typer
  • Terminal UI powered by Rich
  • Docker SDK by Docker Inc.
  • Kubernetes Python Client

📧 Contact


Transform your container management with Docky! 🚀

About

Docker container management tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors