Turn a chroot environment into a bootable image.
$ debootstrap --variant=minbase focal focal_tree http://archive.ubuntu.com/ubuntu/
$ debootstick --config-root-password-none focal_tree img.dd
$ dd if=img.dd of=/dev/<your_device> bs=10M
Your USB device now embeds a live Ubuntu system and can be booted on any UEFI or BIOS computer.
A more interesting example:
$ docker run -it --name mycontainer --entrypoint /bin/bash eduble/rpi-mini
> [... customize ...]
> exit
$ mkdir mycontainer_fs; cd mycontainer_fs
$ docker export mycontainer | tar xf - ; docker rm mycontainer
$ cd ..
$ debootstick --config-root-password-none mycontainer_fs rpi.dd
$ dd if=rpi.dd of=/dev/mmcblk0 bs=10M
Your Raspberry Pi now boots your customized OS!
The embedded system is:
On the wiki at https://github.com/drakkar-lig/debootstick/wiki, you will find: