debos(1)
π debos(1) π
okay bestie, welcome to the debos manual page β it's debos(1), and it's the one where we learn how to build Debian OS images. sit down, grab a strawberry matcha, we're doing this π
β¨ NAME β¨
debos β Debian OS images builder π¦
β¨ SYNOPSIS β¨
debos [options] <recipe file in YAML>
debos [--help]
Application Options:
-b,--fakemachine-backend=β the Fakemachine backend to use (default:auto)--artifactdir=β the directory for packed archives and ostree repositories (default: current directory)-t,--template-var=β template variables (use-t VARIABLE:VALUEsyntax)--debug-shellβ fall into an interactive shell on error-s,--shell=β redefine the interactive shell binary (default: bash) (default:/bin/bash)--scratchsize=β size of disk backed scratch space-c,--cpus=β number of CPUs to use for the build VM (default:2)-m,--memory=β amount of memory for the build VM (default:2048MB)--show-bootβ show boot/console messages from the fake machine-e,--environ-var=β environment variables (use-e VARIABLE:VALUEsyntax)-v,--verboseβ verbose output--print-recipeβ print the final recipe--dry-runβ compose the final recipe to build but without any real work started--disable-fakemachineβ do not use fakemachine.
β¨ DESCRIPTION β¨
debos is the tool that makes creating all sorts of Debian-based OS images so much simpler. like, most other tools out there hyperfixate on one specific use-case π but debos is designed as a toolchain β it makes the common actions basically trivial while still handing you enough rope to do whatever behind-the-scenes tweaking you might need. main character energy tbh π
debos expects a YAML file as input. a general overview of a YAML recipe and of the templating engine it uses lives in the debos recipe syntax documentation π
debos runs the actions listed in the recipe file sequentially, one after another. and the way that these actions should be self-contained and independent of each other?? iconic. no cap.
some of the actions debos provides to customise and produce images are:
- apt: install packages and their dependencies with
apt - debootstrap: construct the target rootfs with
debootstrap - download: download a single file from the internet
- filesystem-deploy: deploy a root filesystem to an image previously created
- image-partition: create an image file, make partitions and format them
- install-deb: install packages and their dependencies from local deb packages
- ostree-commit: create an OSTree commit from rootfs
- ostree-deploy: deploy an OSTree branch to the image
- overlay: do a recursive copy of directories or files to the target filesystem
- pack: create a tarball with the target filesystem
- pacman: install packages and their dependencies with
pacman - pacstrap: construct the target rootfs with
pacstrap - raw: directly write a file to the output image at a given offset
- recipe: includes the recipe actions at the given path
- run: allows to run a command or script in the filesystem or in the host
- unpack: unpack files from archive in the filesystem
a full syntax description of all the debos actions lives in the debos actions documentation π
β¨ GET IN TOUCH! β¨
- π¬ join us on Matrix at
#debos:matrix.debian.socialto chat about usage or development of debos. - πͺ² to report a bug, issue or feature request, create a new GitHub Issue.
- β please use the GitHub Discussion forum to ask questions about how to use Debos or to discuss best ways of creating recipes.
like, the community is right there, come say hi π«Ά
β¨ INSTALLATION (DOCKER CONTAINER) β¨
there's an official debos container available π
docker pull godebos/debos
see docker/README.md for usage.
β¨ USING DEBOS IN GITHUB ACTIONS β¨
debos can be run in GitHub Actions using the official container with KVM support for isolated and reproducible builds π₯ the --fakemachine-backend=kvm option is specified to ensure KVM is used as expected:
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/go-debos/debos:main
options: --device=/dev/kvm
steps:
- uses: actions/checkout@v4
- run: debos --fakemachine-backend=kvm --print-recipe recipe.yaml
β¨ INSTALLATION FROM SOURCE (UNDER DEBIAN) β¨
sudo apt install golang git libglib2.0-dev libostree-dev qemu-system-x86 \
qemu-user-static debootstrap systemd-container
export GOPATH=/opt/src/gocode # or whatever suits your needs
go install -v github.com/go-debos/debos/cmd/debos@latest
/opt/src/gocode/bin/debos --help
β¨ SIMPLE EXAMPLE β¨
the following example will create an arm64 image, install several packages in it, change the file /etc/hostname to debian and finally make a tarball of the complete system πΈ
{{- $image := or .image "debian.tgz" -}}
architecture: arm64
actions:
- action: debootstrap
suite: trixie
components:
- main
- non-free-firmware
mirror: https://deb.debian.org/debian
variant: minbase
- action: apt
packages:
- sudo
- openssh-server
- adduser
- systemd-sysv
- firmware-linux
- action: run
chroot: true
command: echo debian > /etc/hostname
- action: pack
file: {{ $image }}
compression: gz
to run it, create a file named example.yaml and run:
debos example.yaml
the final tarball will be named debian.tgz. and if you would like to modify the fileame, you can provide a different name for the variable image like this:
debos -t image:"debian-arm64.tgz" example.yaml
β¨ OTHER EXAMPLE RECIPES β¨
see the bundled example recipes for some more detailed example recipes. additional more detailed example recipes are stored under debos-recipes π
β¨ ENVIRONMENT VARIABLES β¨
debos reads a predefined list of environment variables from the host and propagates them to the fakemachine build environment. the set of environment variables is defined by environ_vars in cmd/debos/debos.go. currently the list of environment variables includes the proxy environment variables documented at:
https://wiki.archlinux.org/index.php/proxy_settings
the list of environment variables currently exported to fakemachine is:
http_proxy, https_proxy, ftp_proxy, rsync_proxy, all_proxy, no_proxy
while the elements of environ_vars are in lower case, for each element both lower and upper case variants are probed on the host and, if found, propagated to fakemachine β¨ so if the host has the environment variables HTTP_PROXY and no_proxy defined, both will be propagated to fakemachine respecting the case. iykyk.
the command line options --environ-var and -e can be used to specify, overwrite and unset environment variables for fakemachine with the syntax:
debos -e ENVIRONVAR:VALUE ...
to unset an environment variable β or in other words, to prevent an environment variable being propagated to fakemachine β use the same syntax without a value. debos accepts multiple -e simultaneously π
β¨ PROXY CONFIGURATION β¨
while the proxy related environment variables are exported from the host to fakemachine, there are two known sources of issues π:
- using
localhostwill not work from fakemachine. use an address which is valid on your network. debos will warn if the environment variables containlocalhost. - in case you are running applications and/or scripts inside fakemachine you may need to check which are the proxy environment variables they use. different apps are known to use different environment variable names and different case for environment variable names.
β¨ FAKEMACHINE BACKEND β¨
debos (unless you're running debos with the --disable-fakemachine argument) creates and spawns a virtual machine using fakemachine and executes the actions defined by the recipe inside the virtual machine π§ this helps ensure recipes are reproducible no matter the host environment. obsessed.
Fakemachine can use different virtualisation backends to spawn the virtual machine β for more information see the fakemachine documentation.
by default the backend will automatically be selected based on what is supported by the host machine, but this can be overridden using the --fakemachine-backend / -b option. and if no backends are supported, debos reverts to running the recipe on the host without creating a fakemachine.
performance of the backends is roughly as follows: kvm is faster than uml is faster than qemu. using --disable-fakemachine is slightly faster than kvm, but requires root permissions β οΈ
benchmark times for running pine-a64-plus/debian.yaml on an Intel Pentium G4560T with SSD:
- backend
--disable-fakemachineβ Wall Time:8 minβ Prerequisites: root permissions - backend
-b kvmβ Wall Time:9 minβ Prerequisites: access to/dev/kvm - backend
-b umlβ Wall Time:18 minβ Prerequisites: packageuser-mode-linuxinstalled - backend
-b qemuβ Wall Time:166 minβ Prerequisites: none
and that's the whole page, bestie π go forth and build images, you're gonna slay.
okay so that's it from the debos(1) manual β this whole thing is the debos(1) page, General Commands Manual vibes, and you've officially read it top to bottom π consider the vibe check passed. mwah π
β¨π¦
π¦ where this page comes from
- ubuntu stonking: debos 1.1.7-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms