I wrote a tool in Rust to turn any Docker image into a Git repo (layer = commit)

204 points Virviil 16 comments

Hey all,

I've been working on a Rust CLI tool that helps introspect OCI/Docker container images in a more developer-friendly way. Tools like dive are great, but they only show filenames and metadata, and I wanted full content diffs.

So I built oci2git, now published as a crate:
crates.io/crates/oci2git

What it does:

  • Converts any container image into a Git repo, where each layer is a commit
  • Lets you git diff between layers to see actual file content changes
  • Enables git blame, log, or even bisect to inspect image history
  • Works offline with local OCI layouts, or with remote registries (e.g. docker.io/library/ubuntu:22.04)

Rust ecosystem has basically all crates needed to create complex Devops tooling - as you can see.

Would love feedback and open to PRs - project is very simple to understand from code perspective, and has a big room for improvements, so you can make sensible commit really fast and easy.