microsoft / RecursiveExtractor

RecursiveExtractor is a .NET Standard 2.0 archive extraction Library, and Command Line Tool which can process 7zip, ar, bzip2, deb, gzip, iso, rar, tar, vhd, vhdx, vmdk, wim, xzip, and zip archives and any nested combination of the supported formats.
MIT License
192 stars 29 forks source link

Add support for Docker images (OCI Format) #78

Open scovetta opened 2 years ago

scovetta commented 2 years ago

We should be able to extract from Docker images - either OSI-compatible or another format.

gfs commented 2 years ago

I did a bit of searching but I was not able to find a C# api for parsing OCI images.

I think the spec is open, if so and we considered it high priority I could implement a parser from the spec, like I did for .ar files (though I suspect the spec for OCI is more complex).

I did find that the Docker cli has a method to export an image as a tar file, if you want a workaround you can use right now.

https://docs.docker.com/engine/reference/commandline/image_save/

gfs commented 2 years ago

OCI image spec:

https://github.com/opencontainers/image-spec

gfs commented 2 years ago

The reference implementation is in go. One potential option is to start with a Go to C# converter like this one: https://go2cs.net/.