Distrobuilder Menu - custom image builder (incus compatible)

About a year ago after building custom LXD images with Hashicorp’s Packer stopped working I started writing distrobuilder-menu to make it easier to build custom LXD / LXC images:

The distrobuilder-menu README should be clear enough to get most users up & running.

I provide examples to build images that incorporate shell customization & cloud-init configuration:

  • Alpine Linux & Ubuntu base images
  • Alpine Linux build environment (alpine-sdk installed on first boot - & cloud-init removed on first boot)
  • Ubuntu Gitlab container (Gitlab installed on first boot)

dbmenu follows a similar methodology to Packer with the idea being that you create:

  • base image (that overrides a standard distrobuilder image - with shell customization’s etc you would like in every image)
  • service image (with web services etc - that uses your base image as the source template)

Under the hood dbmenu uses the Go version of yq to merge template overrides & standard cloud-init yaml into an existing template (using PyYaml for merging did not give good results)

I added incus compatibility recently so dbmenu should work for everyone.

  • Installation as an isolated app should always work (pipx is how I install at the moment):

  • pipx install git+https://github.com/itoffshore/distrobuilder-menu.git

Updating LXD version data: /home/stuart/devops/distrobuilder/templates/lxd.json ... 
Caching JSON data to: /home/stuart/devops/distrobuilder/templates/cache.json
Wrote configuration as json to: /home/stuart/devops/distrobuilder/templates/cache.json

Querying the Github REST API: https://api.github.com/repos/lxc/lxc-ci/contents/images

 Saved to: ==> /home/stuart/devops/distrobuilder/templates/images/nixos.yaml

 Saved to: ==> /home/stuart/devops/distrobuilder/templates/images/openwrt.yaml
  • custom templates are now auto regenerated as part of the standard template update / downloads (since v0.2.1)

  • Empty input from every menu / choice returns you to the main menu (main event loop).

Hopefully you find dbmenu useful:

Comments / criticism welcome - there’s always room for improvements ;o)


1 Like
  • automatic custom template regeneration incorporated into standard template downloads in v0.2.1

  • see the README for a screenshot

1 Like

Thank you so much for your library!

1 Like

Thanks for testing - dbmenu is now installable from pypi:

pipx || pip install distrobuilder-menu

1 Like

App updates added in version 0.2.5 via pipx or pip

  • just run: dbmenu -v

1 Like