Keep in-repo agent scratch out of the build context and out of git (closes #27)
The canonical .dockerignore and .gitignore both omitted the in-repo agent scratch directory, which holds one worktree per in-flight agent, so under `COPY . .` an entire extra checkout of the repo reached the image. The two entries are deliberately different shapes: anchored in .dockerignore, where the `**/` form would also delete a legitimately named nested directory, and unanchored in .gitignore, where a pattern already matches at every depth. Anchoring leaves a gap where agents run in subdirectories, stated in the vendored file itself. The second half is the consequence of excluding .git: `git describe` in a build stage yields an empty version without erroring, so the version is now computed on the host and passed in. Model: opus-5
This commit is contained in:
11
README.md
11
README.md
@@ -123,10 +123,13 @@ alpine. We provide:
|
||||
- `script/check` — run all checks: `test`, `lint`, `fmt-check` (our own
|
||||
extension)
|
||||
- `script/docker` — build the Docker image, tagged via `script/projectname`
|
||||
(byte-identical across repos); builds with `--no-cache`, like `script/cibuild`
|
||||
- `script/cibuild` — cd to the repo root and `docker build --no-cache .` (what
|
||||
CI runs; the image build runs `script/check`, and `--no-cache` is what stops
|
||||
Docker serving those checks from cache on an unchanged tree)
|
||||
(byte-identical across repos); same `--no-cache` and `VERSION` as
|
||||
`script/cibuild`
|
||||
- `script/cibuild` — cd to the repo root, compute `version` from `git describe`,
|
||||
then `docker build --no-cache --build-arg VERSION="$version" .` (what CI runs;
|
||||
the image build runs `script/check`, `--no-cache` is what stops Docker serving
|
||||
those checks from cache on an unchanged tree, and the version is computed on
|
||||
the host because `.dockerignore` excludes `.git`)
|
||||
- `script/precommit` — run by the git pre-commit hook (our own extension); calls
|
||||
`script/check`
|
||||
- `script/install-precommit` — installs the git pre-commit hook (our own
|
||||
|
||||
Reference in New Issue
Block a user