diff --git a/scripts/apricot-run.sh b/scripts/apricot-run.sh index 3c887c9c..c8d61891 100755 --- a/scripts/apricot-run.sh +++ b/scripts/apricot-run.sh @@ -200,6 +200,12 @@ DOCKER_BUILDKIT=1 docker build \\ --file "\${SCRATCH}/tools/docker/Dockerfile.mc-ai" \\ "\${SCRATCH}" +# Pre-create the bind-mount target as the host user. Without this, dockerd +# (running as root) auto-creates /work/.local + /work/.local/out as root +# when it materialises the bind mount, leaving lilith-unwritable directories +# behind that break `git worktree remove` at cleanup time. +mkdir -p "\${SCRATCH}/.local/out" + # Trap → docker kill any container we started, so an OOM-killed or # externally-stopped launcher doesn't leave the daemon-owned container # running past the systemd unit's lifetime.