Skip to main content

AI-powered Docker configuration generator with self-healing builds

Project description

wunderunner

AI-Powered Docker Configuration Generator

Analyze your project, generate Dockerfiles & docker-compose.yaml, and learn from build errors with AI.


wunderunner (wxr) is a CLI tool that uses AI agents to analyze your codebase and generate production-ready Docker configurations. Point it at any project and it figures out the rest: scanning your dependencies, generating optimized Dockerfiles, and building containers.

Self-healing by design. When builds fail, wunderunner doesn't just report errors. It analyzes logs, identifies the root cause, fixes the configuration, and tries again. This iterative loop continues until your container runs successfully or the issue requires human intervention.

Built with Pydantic AI for structured agent workflows. Inspired by Repo2Run and Railpack.


Quick Start

# Set your API key
export ANTHROPIC_API_KEY=sk-ant-...

# Run on any project
uvx wunderunner /path/to/your/project

That's it. wunderunner analyzes your project and generates Docker configs.


How It Works

flowchart TD
    Analyze[🔍 Analyze Project] --> secrets{Secrets?}
    secrets -->|yes| CollectSecrets[🔐 Collect Secrets]
    secrets -->|no| Dockerfile
    CollectSecrets --> Dockerfile

    Dockerfile[📄 Generate Dockerfile] --> Validate[✅ Validate]
    Validate -->|pass| Services[🐳 Generate Compose]
    Services --> Build[🔨 Build Image]
    Build --> Start[🚀 Start Containers]
    Start --> Healthcheck[💓 Healthcheck]
    Healthcheck -->|healthy| Success((✨ Success))

    Validate -->|fail| RetryOrHint
    Build -->|fail| FixProject[🔧 Fix Project]
    Start -->|fail| FixProject
    Healthcheck -->|fail| FixProject

    FixProject -->|fixed| Dockerfile
    FixProject -->|can't fix| RetryOrHint

    RetryOrHint{Retry?} -->|attempts left| Dockerfile
    RetryOrHint -->|exhausted| HumanHint[💬 Ask Human]
    HumanHint --> Dockerfile

The loop continues until success. Each failure feeds back as a learning, informing the next generation attempt with specific context about what went wrong and how to fix it.


Features

Feature Description
Project Analysis Reads package.json, requirements.txt, Cargo.toml, go.mod, and more
Smart Defaults Chooses appropriate base images, build stages, and runtime configs
Self-Healing Builds Automatically diagnoses failures, fixes configs, and retries
Iterative Learning Each error informs the next attempt until the build succeeds

Key Concepts

Human in the Loop

When automatic retries are exhausted, wunderunner asks for help instead of giving up. You provide a hint, maybe the project needs a specific system dependency, or uses an unconventional setup. Your hint becomes part of the context for the next attempt.

❌ Build failed after 3 attempts
💬 What should I know about this project?
> This uses puppeteer and needs chromium installed

✓ Got it. Retrying with that context...

Learnings & Context

Every failure teaches the system something. Learnings accumulate across retry cycles:

  • Phase: Where it failed (build, start, healthcheck)
  • Error type: What kind of failure occurred
  • Error message: The actual error output
  • Context: Additional info (previous fixes tried, human hints)

The Dockerfile generator receives all learnings, allowing it to avoid repeating mistakes and build on what worked.

Caching

Analysis results are cached in .wunderunner/ to avoid re-scanning unchanged projects:

wxr /path/to/project           # Uses cache if available
wxr /path/to/project --rebuild # Ignores cache, fresh analysis

Cached artifacts:

  • Project structure analysis
  • Detected runtime and framework
  • Environment variables and secrets
  • Generated Dockerfile and docker-compose.yaml

Runtime Healing

Failures during build, start, or healthcheck trigger the FixProject agent. This agent can:

  • Modify project files (add missing configs, fix entry points)
  • Update package dependencies
  • Add required system packages to Dockerfile
  • Fix environment variable issues

If FixProject succeeds, it resets the retry counter, giving the workflow fresh attempts with the fixed configuration.


License: MIT | Python: 3.11+ | CLI: wxr

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

wxr-0.1.1.tar.gz (208.1 kB view details)

Uploaded Source

Built Distribution

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

wxr-0.1.1-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

Details for the file wxr-0.1.1.tar.gz.

File metadata

  • Download URL: wxr-0.1.1.tar.gz
  • Upload date:
  • Size: 208.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wxr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7db192d374f161bac6bba8242038f2ac32b17c21467d9d61f2b5f64c6444da2c
MD5 102e51da59117d9691da7048d1b5d226
BLAKE2b-256 8bd66a3d1836ae13a62aa32fdd60444c05505dc4fcf0cf7fa8c02badedfc994e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wxr-0.1.1.tar.gz:

Publisher: ci.yml on wunderlabs-dev/wunderunner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wxr-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: wxr-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 59.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wxr-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03a6cb08f581660930efa5d8117aed4408d363deea703a06263f18a47f89cd50
MD5 1648814df6cfde5f027460f4a957c73c
BLAKE2b-256 3b5d57cdf7d9171fecb8d52515232aa9ac2be1a52dbd7c58ddcd6e431ea3e78d

See more details on using hashes here.

Provenance

The following attestation bundles were made for wxr-0.1.1-py3-none-any.whl:

Publisher: ci.yml on wunderlabs-dev/wunderunner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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