Menu

1 / 3

'Dubious Ownership': The 2022 Git CVE Behind the Error Your Agent's Container Hits

DEV Community: docker·Gabriel Anhaia·8 days ago
#B2qfzN7L
#devtodocker#devto#dev#directory#user
Reading 0:00
15s threshold

Book: AI Agents Pocket Guide

The series: Pocket Guides for Developers — 8 short books on agents, RAG, prompts, observability, events, databases and system design — the whole series

My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools

Me: xgabriel.com | GitHub

Claude Code rejects --dangerously-skip-permissions when it's launched as root, per its dev container docs , so the container you build for an agent that runs without permission prompts uses a non-root user, say node at uid 1000. Your host account is uid 1001, and you start the container with plain docker run , the repo bind-mounted from the host. The agent's first git status comes back with this:

fatal: detected dubious ownership in repository at '/work' To add an exception for this directory, call:

git config --global --add safe.directory /work

Enter fullscreen mode

Exit fullscreen mode

That is the message template in Git's setup.c , with /work as the path. The fix it suggests is one line.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.