Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

DockerForge - AI-Powered Dockerfile Generator

DockerForge is an agentic AI tool that accepts a GitHub repository URL, analyzes the codebase, generates a working Dockerfile, builds and tests it, and retries automatically if the build fails.


Architecture

The tool follows this flow:

  1. User submits a public GitHub repository URL via the web interface
  2. The backend clones the repository and scans its file structure
  3. Key files like requirements.txt, package.json, go.mod are read and analyzed
  4. The file structure and contents are sent to an LLM to generate a Dockerfile
  5. The agent runs docker build and captures the output
  6. If the build fails, the error is sent back to the LLM which reasons about the fix and regenerates the Dockerfile
  7. Steps 5 and 6 repeat up to 3 attempts maximum
  8. The agent runs docker run to verify the container starts successfully
  9. The final working Dockerfile is displayed to the user in the UI

Tech Stack

  • Backend: Python, FastAPI
  • Frontend: HTML, CSS, JavaScript
  • AI Provider: Groq API with llama-3.3-70b-versatile
  • Container: Docker via subprocess calls

Setup Instructions

Prerequisites

  • Python 3.10 or higher
  • Docker Desktop installed and running
  • Git installed
  • Groq API key, free at https://console.groq.com

Run Locally

Clone the repository:

git clone https://github.com/Shrutir15/dockerforge.git
cd dockerforge

Install dependencies:

pip install -r requirements.txt

Set your Groq API key on Windows:

set GROQ_API_KEY=your_groq_api_key_here

Set your Groq API key on Mac or Linux:

export GROQ_API_KEY=your_groq_api_key_here

Start the server:

uvicorn main:app --host 0.0.0.0 --port 8000

Open your browser and go to http://localhost:8000

Run with Docker

Build the image:

docker build -t dockerforge .

Run the container:

docker run -p 8000:8000 -e GROQ_API_KEY=your_groq_api_key_here dockerforge

Open your browser and go to http://localhost:8000


LLM Provider

Provider: Groq Model: llama-3.3-70b-versatile

Reasons for choosing Groq:

  • Free to use with generous rate limits
  • Extremely fast inference speed compared to other providers
  • High quality code generation capabilities
  • OpenAI-compatible API making integration simple
  • No credit card required to get started

Known Limitations and Edge Cases

  • Private GitHub repositories are not supported, only public repositories work
  • Very large repositories may take longer to clone and analyze
  • Complex multi-service applications may require docker-compose which is not yet supported
  • Build timeout is set to 5 minutes maximum per attempt
  • The agent makes a maximum of 3 retry attempts if the build fails
  • Some repositories with unusual project structures may not be detected correctly
  • Windows line endings are handled but may occasionally cause issues in generated Dockerfiles

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages