Can libpod be used from other programming languages than go? Is there a C api?
Thanks
As of now, we do not have a C API at present (though, if someone was willing to navigate the mess that is calling Go from C, we'd be happy to accept one!). At present, your best bet is likely to be the Podman varlink API - I believe there are C bindings for Varlink.
There's work well under way to provide a VarLink (https://varlink.org/) API under libpod/pkg/varlink. I know work is ongoing for Python and you can use VarLink with C from what I know, but I've not tried it.
@TomSweeneyRedHat That's cmd/podman/varlink actually
varlink... interesting. How does the program consume the varlink api? Is there a daemon on the other end?
@tmds Sort of. We launch a Podman process on the other end to handle the request. It can act as a daemon, but usually it dies after a few seconds of not servicing requests.
Thanks everyone!
@tmds What were you wanting to do with the API or library?
@rhatdan I didn't have an explicit goal in mind. I wanted to check out the API to understand better what I can do with libpod.
Ok. the goal of libpod is to allow tools like cri-o and podman deal with containers and pods. We would hope that potentially others would come along to also build tools to use the library. We had no goal to allow it to be used by tools other then GOLang.
varlink is all about an API into the podman command. So you could execute podman commands via languages like python and javascript (Cockpit?).
Eventually we want to make varlink available via TCP/SSH so people could use containers from a separate machine, think Macs, and Windows.
@rhatdan @mheon @TomSweeneyRedHat fyi, I implemented a varlink client for .NET: https://github.com/tmds/Tmds.Varlink
Huh, that's pretty cool! Nice work!
@tmds Would you like to write a blog about this? Then we could social media it.