https://github.com/containers/podman-bootc
https://github.com/containers/podman-bootc
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/containers/podman-bootc
- Owner: containers
- License: apache-2.0
- Created: 2024-04-22T15:04:01.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-14T15:17:35.000Z (over 1 year ago)
- Last Synced: 2025-03-23T19:44:38.360Z (over 1 year ago)
- Language: Go
- Size: 323 KB
- Stars: 36
- Watchers: 12
- Forks: 12
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Streamlining podman + bootc interactions
This project aims to address
in alignment with the project.
## Goals
- Be a scriptable CLI that offers an efficient and ergonomic "edit-compile-debug" cycle for bootable containers.
- Be a backend for
- Work on both MacOS and Linux
## Running
First and foremost, `podman-bootc` requires a *rootful* Podman Machine to be
running, which is the default on MacOS and Windows. On Linux, make sure to
create a Podman Machine via `podman machine init --rootful --now` which implies
that you need to run podman with `--remote` command to make built images
available to `podman-bootc`.
The core command right now is:
```shell
podman-bootc run
```
This command creates a new virtual machine, backed by a persistent disk
image from a "self install" of the container image, and makes a SSH
connection to it.
This requires SSH to be enabled by default in your base image; by
default an automatically generated SSH key is injected via a systemd
credential attached to qemu.
Even after you close the SSH connection, the machine continues to run.
### Other commands:
- `podman-bootc list`: List running VMs
- `podman-bootc ssh`: Connect to a VM
- `podman-bootc rm`: Remove a VM
### Architecture
At the current time the `run` command uses a
[bootc install](https://containers.github.io/bootc/bootc-install.html)
flow - where the container installs itself executed in a privileged
mode inside the podman-machine VM.
The installation target is a raw disk image is created on the host, but loopback
mounted over virtiofs/9p from the podman-machine VM.
(The need for a real-root privileged container to write Linux filesystems is part of the
rationale for requiring podman-machine even on Linux is that
it keeps the architecture aligned with MacOS (where it's always required))
In the future, support for installing via [Anaconda](https://github.com/rhinstaller/anaconda/)
and [bootc-image-builder](https://github.com/osbuild/bootc-image-builder)
will be added.
## Installation
### MacOS
First be sure you have the Podman Desktop [bootc extension requirements](https://github.com/containers/podman-desktop-extension-bootc?tab=readme-ov-file#requirements).
On MacOS you can use homebrew to install podman-bootc:
```
brew tap germag/podman-bootc
brew install podman-bootc
```
alternatively, you can download the latest development cutting-edge source
```
brew install --head podman-bootc
```
It will install xorriso and libvirt, but it doesn't install qemu.
You need to install qemu manually, using brew:
```
brew install qemu
```
or by other mean and make it available in the path.
### Fedora
For Fedora 40+ and Rawhide we provide a COPR repository.
First, enable the COPR repository:
```
sudo dnf -y install 'dnf-command(copr)'
sudo dnf -y copr enable gmaglione/podman-bootc
```
then you can install `podman-bootc` as usual:
```
sudo dnf -y install podman-bootc
```
## Building from source:
Our generic dependencies:
- qemu-system-x86_64 / qemu-system-aarch64
- xorriso/osirrox
- golang
- libvirt-devel
To compile it, just run in the project directory:
```shell
make
```