Linux Containers - distrobuilder - Introduction
- distrobuilder
- Introduction
What's distrobuilder?
distrobuilder is an image building tool for LXC and Incus.
It's used to build all our official images available on our image server.
The image definition is a YAML document which describes the source of the image, its package manager, what packages to install/remove for specific image variants, os releases and architectures, as well as additional files to generate and arbitrary actions to execute as part of the image build process.
The output is either a plain root filesystem, an Incus image or a LXC image.
You can see it at work here: https://jenkins.linuxcontainers.org/view/Images/
Installing it
Release tarballs can be found in the Downloads section.
The current build can also be installed directly with:
go install -v -x github.com/lxc/distrobuilder/distrobuilder@latest
Language, licensing and contributions
distrobuilder is written in Go, it's free software and is developed under the Apache 2 license.
There are no CLA or similar legal agreements required to contribute to distrobuilder, however we do require commits be signed-off (following the DCO - Developer Certificate of Ownership).
NOTES:
root@host:~# lxc-create --name lxc-container --template download
Distribution:
debian
Release:
bookworm
Architecture:
amd64
Downloading the image index
Downloading the rootfs
Downloading the metadata
The image cache is now ready
Unpacking the rootfs
You just created a Debian bookworm amd64 (20250926_05:24) container.
To enable SSH, run: apt install openssh-server
No default root or user password are set by LXC.
No default root or user password are set by LXC.
lxc-start --name lxc-container
lxc-info --name lxc-container
lxc-ls --fancy
lxc-attach --name lxc-container
added garyrust
created openssh-server for garyrust
apt upgrade
apt update
apt install mc
SEE: With MX23 Linux can I transfer - Perplexica - docker
lxc-attach --name lxc-container
root@lxc-container:~# ifcconfig
bash: ifcconfig: command not found
root@lxc-container:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 5e:78:95:e8:71:8c brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.0.3.214/24 metric 1024 brd 10.0.3.255 scope global dynamic eth0
valid_lft 2935sec preferred_lft 2935sec
inet6 fe80::5c78:95ff:fee8:718c/64 scope link
valid_lft forever preferred_lft forever