Skip to main content

Convert OCI images to bootable disk images

Project description

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"

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bootoci-0.3.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bootoci-0.3.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file bootoci-0.3.0.tar.gz.

File metadata

  • Download URL: bootoci-0.3.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bootoci-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3e37436aadd8f63cffcff47c2d7e51ff051b279f0dabc61c6631ce842b4dbd53
MD5 0540d492e264f5216ca788a10b19c65f
BLAKE2b-256 a429027d21c6a8951f7326453ac658ee092de4a549e0c8a38082304138752728

See more details on using hashes here.

File details

Details for the file bootoci-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: bootoci-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bootoci-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 095998a09bde5c45206eb48599415436f17daf4524e88f4ffb6237d39bad8b1b
MD5 3c40897fc0c034ff54ac67eaa62f7369
BLAKE2b-256 e8c1be56444731413580389942e27481c8cffbcb81a38fdd22e9fc103cbbf9ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page