tinyrange / pkg2

Package Metadata Database
https://pkg2.thrush-map.ts.net/
Apache License 2.0
2 stars 0 forks source link

Automatically generate built containers from source code. #9

Open Vbitz opened 4 months ago

Vbitz commented 4 months ago

The long term goal of pkg2 is the ability to automatically generate working containers with built tools from a source code repository.

Starting with a simple example. Say I want a Docker container for pkg2. How do I do that?

pkg2 is an easy example since it's a pure Go project. You can build it with nothing but a go compiler a checkout of the source code (all you need to do is run go run . in the repo).

C/C++ is where this gets more complicated. Dependencies are only evident once the source files are parsed and the compile commands are called. Since the compile commands have so many configuration knobs and builds are so slow developers rely on build systems to create complex dependency graphs.

The theory here is combining heuristics for build system detection and our package database we can automatically infer a recipe to build a container/rootfs from a source repository. This won't work in every situation (it can't possibly) but the more instances it does work the less work package maintainers have to do by hand.