# Build Detection & Overrides

> Understand how build types are detected and override commands.

- **Category**: Deploy & Configure
- **Last Verified**: 2026-07-14

When deploying from a repository, Kubeletto runs a build detection stage to determine how to compile your application. It operates under a strict order of operations.

## Build Type Detection Order

- **Pre-built Image**: If the `--image` flag is set, no build is executed.
- **Dockerfile**: If a `Dockerfile` exists at your configured path (default: root `/Dockerfile`), Kubeletto executes a BuildKit Dockerfile build.
- **Buildpacks (Docker Auto-Gen)**: If no Dockerfile is found, Kubeletto analyzes your files (e.g., `package.json`, `requirements.txt`, `go.mod`) and auto-generates a temporary Dockerfile matching your runtime.

> [!WARNING]
> Kubeletto does NOT run native Cloud Native Buildpacks (CNB) or Heroku buildpacks at build-time. It analyzes language files and synthesizes a static Dockerfile. If your project is complex, we highly recommend adding a custom Dockerfile to the repository root.

## Configuring Command Overrides

For buildpack-detected repositories, you can override the install, build, and start commands:

```bash
kubeletto deploy my-app --repo git@github.com:org/repo.git --port 8080
```

