vrothberg / bootc-playground

bifrost examples
Apache License 2.0
5 stars 2 forks source link

Playground for bootc

The playground attempts to facilitate booting into a bootc-enabled VM. You may boot into a Fedora Core OS VM or a Fedora Cloud image. The Makefile tries to hide the details of downloading, running and provisioning the VMs which can consume a considerable amount of time.

Prerequisites

The workflow is based on a Makefile and works on Linux only. You need the following package prior to using the Makefile:

sudo dnf install git make coreos-installer qemu virt-install

You may need to chmod o+x $HOME in order for make vm-install to succeed.

Install a bootc-enabled Fedora CloudVM

The VM is provisioned via cloud init. Note that you need to SSH into the machine since you will not (yet) get access to the console on install.

The default user is core with the password core. Once you have the VM installed and running, you are ready to play with bootc.

Mount Host Directories

If you want to mount a host directory into the VM, set the VM_MOUNT environment variable and run make vm-install-*. The variable will instruct virt-install to setup a virtiofs mount with the playground-mount tag. The specified VM_MOUNT is automatically mounted at /var/playground. You may mount it to a custom path via $ sudo mount -t virtiofs playground-mount /custom/path.

If you want to try out a development version of bootc or test a pull request, you may point VM_MOUNT to your local bootc Git tree. The local Git tree can then be mounted into the VM and the host's bootc can be executed directly.

Install a Fedora CoreOS VM

You may also start off an ostree-enabled system, such as Fedora CoreOS. Once installed, you can rebase the system to a bootable container and go from there. To do that, follow the instructions below:

Rebase Fedora CoreOS Image

Once your VM has booted, you may rebase your image as described in the CentOS boot documentation. That will rebase your VM into a bootable image with bootc installed.

Alternatively, we could rpm-ostree install bootc and run bootc install{-to-filesystem} (see bootc-install docs). However, https://github.com/containers/bootc/pull/137 needs to be addressed before we're able to do that though. Hence, the suggested rebase when starting with a vanilla CoreOS image. The instructions will be updated here once things run smoothly.

Note that bootc-install-alongside already works on non os-tree hosts.