Skip to main content

BootOCI

What does it do?

BootOCI aims to create bootable disk images from OCI images (Docker container images).

It leverages the build cache feature of buildx / buildah to create efficient and fast builds.

This project exists because I wasn't satisfied with other solutions and I really like Docker.

  1. live-build - way too complicated, hard to keep track of changes
  2. mkosi - never actually got it to work properly

Tech stack

Installation

Currently supports Linux only.

Just run:

pip install bootoci

Usage examples

Debian 12 that boots into a shell:

bootoci -o ./bin/disk.img --docker --ash --kernel-from-debian --tag debian:12 --size 1024

Debian 12 with an upstream kernel:

bootoci -o ./bin/disk.img --docker --ash --kernel-from-source --tag debian:12 --size 1024

Ubuntu 24.04 with a serial ash shell:

bootoci -o ./bin/disk.img --docker --ash --kernel-from-debian --tag ubuntu:24.04 --serial

Debian 13 with GNOME, hostname and user passwords, in QCOW2 format:

bootoci -o ./bin/disk.img --docker --kernel-from-debian --tag debian-gnome --dockerfile ./examples/debian-gnome.Dockerfile --size 8192 --password root:12345678 --password user:12345678 --serial --format qcow2

Postgres server that starts on boot:

bootoci -o ./bin/disk.img --docker --kernel-from-debian --tag postgres --dockerfile ./examples/postgres-alpine.Dockerfile --size 1024 --entrypoint --serial

Usage in development

# Build a fully-fledged ubuntu desktop machine
python3 -m src.bootoci.cli --docker --kernel-from-debian -f ./examples/ubuntu-desktop.Dockerfile --size 4096 --serial --password "root:12345678" --password "user:12345678"

# Build a test image
python3 -m src.bootoci.cli --docker --kernel-from-debian -f ./examples/entrypoint.Dockerfile --size 1024 --password "root:12345678" --entrypoint

Testing images

# Test for UEFI boot
qemu-system-x86_64 -enable-kvm -M q35 -m 2G -bios /usr/share/ovmf/OVMF.fd -drive file=./bin/disk.img,format=raw

# Test for Legacy (BIOS) boot (not supported)
# qemu-system-x86_64 -enable-kvm -M q35 -m 2G -drive file=./bin/image.raw,format=raw

TODO

  • Hybrid boot that supports Legacy and UEFI boot

Metadata

Release files for bootoci 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bootoci 0.6.0
File Size Uploaded Provenance Actions
bootoci-0.6.0.tar.gz 10.3 kB Without provenance Details for bootoci-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bootoci 0.6.0
File Interpreter ABI Platform Actions
bootoci-0.6.0-py3-none-any.whl Python 3 none any Details for bootoci-0.6.0-py3-none-any.whl

Total release size: 19.9 kB

Release files / bootoci-0.6.0.tar.gz

Download URL bootoci-0.6.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
294c6c5e36a54df8d04bdbfa33ac3f22cecb9f5bbe903eb235803c7d53fc55c7
BLAKE2b-256 checksum
How to use checksums
a2363bf14d961cf435f88321232164404a0440cf61b039ad900ad25e9885caba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / bootoci-0.6.0-py3-none-any.whl

Download URL bootoci-0.6.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98ed7908f9a1d1b8205b6c632de15206359a76a10a978b5235cec474b344b791
BLAKE2b-256 checksum
How to use checksums
2d1f4ffa1fac49f57edf1b64247f0037bb99da8cd7a45e964e57c5285b27345f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for bootoci 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page