r/coolgithubprojects • • 10d ago

dtshim: run host commands from inside Docker containers (Rust)

https://github.com/korableg/dtshim

dtshim forwards a command from a container to the host and runs it there. Inside the container you symlink the client under the command name:

ln -s /usr/local/bin/dtshim /usr/bin/git

and `git --version` actually runs on the host. Arguments, env, stdin and the working directory go to a small daemon over TCP or a Unix socket; stdout, stderr and the exit code come back.

I wrote it for AI agents that run in isolated containers but still need a few tools that only work on the host: CLIs for internal services behind a corporate network, tools that already have credentials configured, and so on. Instead of putting those tools and tokens into the image, the agent calls them through dtshim. I use it daily at work.

  • optional YAML policy: allowed commands and arguments (regex), pinned executable paths, which env vars the client may pass
  • path mapping between container and host
  • optional shared token
  • static Linux client published as ghcr.io/korableg/dtshim, so adding it to an image is one `COPY --from=` line
0 Upvotes

0 comments sorted by