Re:Crafting container images without Dockerfiles
by webstrand on Monday February 06, 2023 @11:36AM
(#34679939)
Do you have an example or an article demonstrating this? I just recently had the desire to build systemd-nspawn images declaratively, but couldn't find much other than Dockerfiles.
[ Parent
| on HN ]
Re:Crafting container images without Dockerfiles
by kevincox on Monday February 06, 2023 @11:43AM
(#34680061)
Sure. Putting a simple binary in a container: https://gitlab.com/kevincox/tiles/-/blob/a2b907eab7a84989c94.... This is the trivial case where you just stick the main executable in the command string. Nix will automatically include the dependencies.
The GitLab CI example is a bit more complex. It requires some commands that are unused by the image and some config files: https://gitlab.com/kevincox/nix-ci/-/blob/efe6f4deedc50c2474...