An intelligent Kiro CLI agent that auto-generates production-ready Dockerfiles by analyzing your codebase — no manual configuration needed.
Eliminate the manual effort of writing Dockerfiles. The agent inspects your project, detects its language and framework, and produces an optimized, secure Dockerfile with a matching .dockerignore.
| Problem | Solution |
|---|---|
| Writing Dockerfiles from scratch | Auto-generates based on project files |
| Bloated images | Enforces minimal base images (alpine/slim) |
| Security risks from root containers | Always sets a non-root user |
| Slow builds | Applies multi-stage builds where beneficial |
Missing .dockerignore |
Auto-generates alongside the Dockerfile |
- Zero config — infers everything from your project files
- Secure by default — non-root user, minimal attack surface
- Optimized images — multi-stage builds, production-only dependencies
- Multi-language support — Node.js, Python, Go, Java, Rust, Ruby, and generic projects
- Consistent output — follows the same best-practice sequence every time
The agent runs 4 skills in sequence:
analyze_project → resolve_strategy → generate_dockerfile → generate_dockerignore
| Skill | What it does |
|---|---|
analyze_project |
Detects language, framework, and port in a single pass |
resolve_strategy |
Decides single-stage vs multi-stage build |
generate_dockerfile |
Writes the optimized Dockerfile with best practices applied |
generate_dockerignore |
Writes the .dockerignore |
1. Clone the repo
git clone https://github.com/ramesherrorhunter/kiro-docker-agent.git2. Copy the agent into your project
cp -r kiro-custom-agents/.kiro /path/to/your/project/Or copy into the current directory:
cp -r kiro-custom-agents/.kiro .That's it — the agent and all skills are now available in your project.
- Kiro CLI installed
- Project directory accessible
1. Navigate to your project
cd /path/to/your/project2. Start Kiro CLI
kiro-cli3. Select the agent
Type /agent and from the dropdown select dockerfile-agent
4. Review generated files
Dockerfile ← production-ready, optimized
.dockerignore ← auto-generated exclusions
5. Build and verify
docker build -t my-app .
docker run --rm my-app| File | Description |
|---|---|
Dockerfile |
Multi-stage, minimal, non-root, port-exposed |
.dockerignore |
Excludes dev files, caches, secrets |
| Indicator File | Detected Language | Default Port |
|---|---|---|
package.json |
Node.js | 3000 |
requirements.txt / pyproject.toml |
Python | 8000 |
go.mod |
Go | 8080 |
pom.xml / build.gradle |
Java | 8080 |
Cargo.toml |
Rust | 8080 |
Gemfile |
Ruby | 3000 |
| (none matched) | Generic | 3000 |
.env.exampleor.env.sample—PORT=<number>package.jsonstart script —PORT=<number>or--port <number>- Framework-specific default (see table above)
- Fallback →
3000
- Default port is
3000if none is detected - Do not manually edit the Dockerfile before the agent finishes
- Re-run the agent after major dependency or framework changes