From a2e4e4ed387d3b5445364e75193ab5b8376be336 Mon Sep 17 00:00:00 2001 From: TheHefty Date: Mon, 3 Aug 2026 16:09:09 +0000 Subject: [PATCH] feat(core): install git-lfs and register its filters system-wide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The image had the `git` package but not `git-lfs`, so a bind-mounted repo that tracks files with LFS was broken inside the container in two ways, both silent: LFS-tracked files checked out as bare pointer stubs, and `git worktree add` failed in its post-checkout hook. Installing the package alone isn't enough. Git LFS's smudge/clean/ pre-push/post-checkout filters are registered in config, and a bind-mounted workspace's .git/config was written on the host, before this image existed — so a repo cloned there has no filter entries this image can rely on. `git lfs install --system` writes them to /etc/gitconfig instead, which covers every repo mounted in without a per-project step. Git treats a missing filter as a no-op rather than an error, which is why both failures surfaced as wrong content rather than as a build or checkout failure. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 4 ++-- core/Dockerfile.frag | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08f3c77..2b6cf44 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,8 @@ libs (for `start` — see [`docs/OVERVIEW.md`](docs/OVERVIEW.md) for the exact p headless emulator additionally needs the host to expose `/dev/kvm`. Select/change them by rerunning `setup`. None of them are mandatory — deselecting everything builds -an image with just the core layer (code-server, Claude Code CLI, `ai-jail`, the GitHub CLI, and the -nested rootless Docker daemon). +an image with just the core layer (code-server, Claude Code CLI, `ai-jail`, the GitHub CLI, Git LFS, +and the nested rootless Docker daemon). ## Versioning diff --git a/core/Dockerfile.frag b/core/Dockerfile.frag index 697d03e..2864faa 100644 --- a/core/Dockerfile.frag +++ b/core/Dockerfile.frag @@ -47,6 +47,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ git \ + git-lfs \ gnupg \ htop \ jq \ @@ -89,6 +90,17 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ | sh -s -- -y --profile minimal --default-toolchain stable \ && chmod -R a+w $RUSTUP_HOME $CARGO_HOME +# 1.2 Registers Git LFS's filters system-wide rather than per-repo. The +# `git-lfs` package above only provides the binary; without this the filters +# live in a repo's own .git/config, which for a bind-mounted workspace was +# written on the host, before this image existed. A repo that already tracks +# LFS files then checks out as bare pointer stubs and `git worktree add` fails +# in post-checkout — both silently, since git treats a missing filter as a +# no-op rather than an error. `--system` writes to /etc/gitconfig, so every +# repo mounted in gets working smudge/clean/pre-push/post-checkout filters +# with no per-project step. +RUN git lfs install --system + # 2. Installs Node.js 22 (LTS) — required by the Claude Code CLI RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ && apt-get install -y nodejs \