Files
brent.edwards eed455d9f9 fix(devcontainer): Dockerfile build fails when .dockerignore excludes .git/ (#1234)
## Summary

Fixes the Docker build failure at step 30/30:
```
fatal: not a git repository (or any of the parent directories): .git
```

## Root Cause

`.dockerignore` excludes `.git/`, so `COPY . $APP_DIR` never copies the `.git` directory into the image. However, the final `RUN` step unconditionally runs `git clean -xdf`, which requires a git repository to exist.

## Fix

Wrapped `git clean -xdf` and `rm -rf .git` in a conditional that checks for `.git` directory existence first, falling through silently when absent:

```dockerfile
([ -d .git ] && git clean -xdf && rm -rf .git || true)
```

This makes the Dockerfile work correctly whether `.git` is present (e.g., if `.dockerignore` is modified) or absent (current behavior).

## Quality Gates

| Gate | Result |
|------|--------|
| lint | Pass |
| typecheck | Pass (0 errors) |
| pre-commit hooks | Pass |

(Dockerfile-only change — no Python code modified, so unit/integration tests are unaffected.)

Closes #1233

Reviewed-on: cleveragents/cleveragents-core#1234
Reviewed-by: Luis Mendes <luis.mendes@cleverthis.com>
Co-authored-by: Brent E. Edwards <brent.edwards@cleverthis.com>
Co-committed-by: Brent E. Edwards <brent.edwards@cleverthis.com>
2026-03-31 21:14:46 +00:00
..