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"

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.2.0.tar.gz (9.6 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.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bootoci-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a0fef7c59abc50f77a14fa2f8a3bca2326d5c4771a9c0b296911d771e737fae5
MD5 5cbd76e18fbd129b89cabf69ca78bba6
BLAKE2b-256 bacfdf4d6f84f9600dea510b26370a4564f276b54f236c31dc0ab5f311f10e0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bootoci-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 274cdfc92e9e1dd058f0ca15fc2de8c1d334cfde7e1f70397572bd70e5bb3cf8
MD5 c5f02573cf410dc4c6664fd177d5c618
BLAKE2b-256 fbd1a9d36a7bddfcf069a2c599b791e283e22a282a853bcfdd32c6911f19e6df

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