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.
The tool follows this flow:
- User submits a public GitHub repository URL via the web interface
- The backend clones the repository and scans its file structure
- Key files like requirements.txt, package.json, go.mod are read and analyzed
- The file structure and contents are sent to an LLM to generate a Dockerfile
- The agent runs docker build and captures the output
- If the build fails, the error is sent back to the LLM which reasons about the fix and regenerates the Dockerfile
- Steps 5 and 6 repeat up to 3 attempts maximum
- The agent runs docker run to verify the container starts successfully
- The final working Dockerfile is displayed to the user in the UI
- Backend: Python, FastAPI
- Frontend: HTML, CSS, JavaScript
- AI Provider: Groq API with llama-3.3-70b-versatile
- Container: Docker via subprocess calls
- Python 3.10 or higher
- Docker Desktop installed and running
- Git installed
- Groq API key, free at https://console.groq.com
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
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
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
- 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