Skip to main content

AI-powered Docker container monitoring, analysis, and optimization CLI.

Project description

DockerBrain

AI-powered Docker container monitoring, optimization, and Dockerfile generation CLI.

Python 3.10+ License: Apache 2.0 PyPI

DockerBrain monitors your Docker containers in real time, detects resource issues, and uses LLMs to generate actionable optimizations for running containers and Dockerfiles. Supports Gemini, Groq, and Ollama. All configuration lives in a single .dockerbrainrc file.


Features

Feature Command LLM Required
Real-time container monitoring dockerb monitor No
AI optimization suggestions dockerb suggest Yes
Auto-fix containers & Dockerfiles dockerb fix Yes
AI Dockerfile generation from project dockerb dockerize Yes
Curated Dockerfile templates dockerb template No
Environment & config diagnostics dockerb env No

Installation

Requirements: Python 3.10+ and a running Docker daemon.

pip install dockerbrain

Verify:

dockerb --version

Configure an LLM Provider

dockerb init

This creates .dockerbrainrc in your project directory. Open it and set your provider and key:

[llm]
provider = "gemini"
model    = "gemini-3.1-flash-lite-preview"
api_key  = "your_key_here"
Provider API Key Link
Gemini Required aistudio.google.com
Groq Required console.groq.com/keys
Ollama Not Required ollama.com

monitor, template, and env commands work without an API key.


Usage

DockerBrain exposes all functionality through the dockerb CLI. Run the following to see all available commands and options:

dockerb --help

Each command also has its own help page, for example dockerb suggest --help, dockerb fix --help, etc.


Pre-commit Hook

DockerBrain can run as a pre-commit hook to lint Dockerfiles on every commit:

# .pre-commit-config.yaml 
repos:
  - repo: https://github.com/iamPulakesh/DockerBrain
    rev: v1.0
    hooks:
      - id: dockerbrain-fix

Development

git clone https://github.com/iamPulakesh/DockerBrain.git
cd DockerBrain
pip install -e ".[dev]"

make test                              
make lint                              
make clean                    

See Changelog.md for the full release history.


Contributing

  1. Fork the repository
  2. Contribute
  3. Open a Pull Request

License

Apache-2.0 — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dockerbrain-1.0.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dockerbrain-1.0-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file dockerbrain-1.0.tar.gz.

File metadata

  • Download URL: dockerbrain-1.0.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for dockerbrain-1.0.tar.gz
Algorithm Hash digest
SHA256 45859ebc43a2edc5c6f29612d931eef3cbd76675724f52445412cc1899f47dc1
MD5 0e7c3d550090e64d1ed8ffa359fefc4b
BLAKE2b-256 a05a6578fed30e307e23d18bd4ff4f6bf8a2349c52888c0ae7103c822623ddde

See more details on using hashes here.

File details

Details for the file dockerbrain-1.0-py3-none-any.whl.

File metadata

  • Download URL: dockerbrain-1.0-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for dockerbrain-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b936e46f2f14c7d23e5c958ce4c99b2ef56e6f9082a1a04b58cf44fd894c499c
MD5 6ebe5d465b6250231f296da45ca1dafe
BLAKE2b-256 e7a86cf8fd865ee122c6ac16f6970962d110a136068feca33c00a29caaf4e26f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page