4 ms·
Hi, thanks for the blog post! > For the last four months I’ve been developing a custom container image builder, collaborating with Outerbounds I know you said
by codethief 2y ago
Hi, thanks for the blog post!
> For the last four months I’ve been developing a custom container image builder, collaborating with Outerbounds
I know you said this was something for another blog post but could you already provide some details? Maybe a link to a GitHub repo?
Background: I'm looking for (or might implement myself) a way to programmatically build OCI images from within $PROGRAMMING_LANGUAGE. Think Buildah, but as an API for an actual programming language instead of a command line interface. I could of course just invoke Buildah as a subprocess but that seems a bit unwieldy (and I would have to worry about interacting with & cleaning up Buildah's internal state), plus Buildah currently doesn't support Mac.
- wofo 2y agoUnfortunately, all the code is proprietary at the moment. If you are willing to get your hands dirty, the main thing to realize is that container layers are "just" tar files (see, for instance, this article: https://ochagavia.nl/blog/crafting-container-images-without-dockerfiles/ https://ochagavia.nl/blog/crafting-container-images-without-...). Contact details are in my profile, in case you'd like to chat ;)
- codethief 2y agoAh too bad :) Thanks for the link! Though I'm less worried about the tarball / OCI spec part, more about platform compatibility. I tried running runc/crun by hand at some point and let's just say I've done things before that were more fun. :)
- cpuguy83 2y agoThis is what buildkit is. Granted go has the only sdk I know of, but the api is purely protobuf and highly extensible.
- cpuguy83 2y agoFor that matter, dagger (dagger.io) provides an sdk in multiple languages and gives you the full power (and then some extra on top) of buildkit.
- throwawaynorway 2y agoIf $PROGRAMMING_LANGUAGE = go, you might be looking for https://github.com/containers/storage https://github.com/containers/storage which can create layers, images, and so on. I think `Store` is the main entry: https://pkg.go.dev/github.com/containers/storage#Store https://pkg.go.dev/github.com/containers/storage#Store Buildah uses it: https://github.com/containers/buildah/blob/main/go.mod#L27C2-L27C31 https://github.com/containers/buildah/blob/main/go.mod#L27C2... Edit: buildkit seems to be the same, used by docker, but needs a daemon?