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.1.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.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bootoci-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 61855b78475f19b9ed006c5d856a53861a8ebf3fbcda989abc94aea870de0ef0
MD5 6d196a8c30d52345e760017d69776f1b
BLAKE2b-256 a96f77ead393c76876a2467b196c4ca7356d417780029a9b67730977f1c92a38

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bootoci-0.3.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2868cae395e37bf25c40962761bd4074ae36ad40537b408d8e65361acf41a4
MD5 92746ab1fd5e26a76e69157f6af93c92
BLAKE2b-256 995cd31168d12fbeca0a4fd74c036f96071e290328bc8bd151e69eb28041e40e

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