Skip to content

systemd/mkosi

Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
main
Switch branches/tags
Code

Latest commit

Test args.architecture instead when selecting the ports.ubuntu.com .
The args.architecture will default to "aarch64" if running on a aarch64
machine and respect command line --architecture switch as well. This is
necessary in case the mkosi is generating foreign architecture container
(e.g. mkosi on amd64 generates arm64 container).

Fix security.ubuntu.com URL, which has to point to ubuntu-ports for
aarch64 machines.
1faaebc

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time

mkosi β€” Build Bespoke OS Images

A fancy wrapper around dnf --installroot, debootstrap, pacman and zypper that generates customized disk images with a number of bells and whistles.

For a longer description and available features and options, see the man page.

Packaging status

Installation

Installing mkosi is easy, as it has no runtime Python dependencies (you will need all the tools to format filesystems and bootstrap the distribution appropriate for your image, though).

If you just want the main branch you can run

python3 -m pip install --user git+https://github.com/systemd/mkosi.git

If you want to hack on mkosi do

# clone either this repository or your fork of it
git clone https://github.com/systemd/mkosi/
cd mkosi
python3 -m pip install --user --no-use-pep517 --editable .

This will install mkosi in editable mode to ~/.local/bin/mkosi, allowing you to use your own changes right away.

For development you also need mypy, for type checking, and pytest, to run tests. We check tests and typing in CI (see .github/workflows), but you can run the tests locally as well.

zipapp

You can also package mkosi as a zipapp that you can deploy anywhere in your PATH. Running this will leave a mkosi binary in builddir/

tools/generate-zipapp.sh

Python module

Besides the mkosi binary, you can also call mkosi via

python -m mkosi

when not installed as a zipapp.

Please note, that the python module exists solely for the usage of the mkosi binary and is not to be considered a public API.

git blame

When using git blame, be sure to add --ignore-revs-file .git-blame-ignore-revs to the arguments to ignore irrelevant code formatting commits. This can be set permanently via the blame.ignoreRevsFile git option.

References