Skip to content

chore: keep agent worktrees out of the Docker build context - #345

Merged
Sawtaytoes merged 1 commit into
mainfrom
chore/dockerignore-worktrees
Sep 29, 2026
Merged

Sawtaytoes merged 1 commit into
mainfrom
chore/dockerignore-worktrees

Conversation

@Sawtaytoes

Copy link
Copy Markdown
Owner

Agents keep git worktrees in .worktrees/. Git ignores that folder through .git/info/exclude, but Docker does not read that file. A docker build run on the host from the shared checkout therefore copied every open worktree into the image. This change adds .worktrees to .dockerignore, with a short comment.

CI builds its image from a clean checkout, so the published image does not change.

Verification

  1. I ran the check on the TrueNAS host while this branch's worktree was open under .worktrees/.
  2. The test Dockerfile was FROM busybox, COPY . /c, RUN ls -a /c, with the new .dockerignore copied next to it as Dockerfile.dockerignore.
  3. The command was DOCKER_BUILDKIT=1 docker build --no-cache --progress=plain -f <tmp>/Dockerfile <repo root>.
  4. Result: the context was 40.38MB, and the listing of /c did not contain .worktrees.
  5. A control run with the old .dockerignore on another repo listed .worktrees, so the check can fail.

🤖 Generated with Claude Code

Agents keep git worktrees in `.worktrees/`, ignored through
.git/info/exclude. A `docker build` run on the host from the shared
checkout copied every open worktree into the image.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Visual regression — queuepilot (vrt)

✅ No visual changes.

changed new deleted unchanged
0 0 0 48

Open the full diff report

@Sawtaytoes
Sawtaytoes merged commit 64f760f into main Sep 29, 2026
5 checks passed
@Sawtaytoes
Sawtaytoes deleted the chore/dockerignore-worktrees branch September 29, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant