Building bootc image with some flatpaks included

Hi all!

I used the template from GitHub - ublue-os/image-template: Build your own custom Universal Blue Image! to setup my own github workflow. I re-configured the Containerfile to use Aurora instead of Bazzite and I have setup cosign proper. My github actions workflow works and I’m able to deploy my bootc image.

Now I’m trying to start customizing the output. In the included /Containerfile and in /build_files/build.sh I find comments and some examples to install packages and to manage system services.

I intend to pre-install some flatpak software from flathub, for example: I’d like to get the brave-browser flathub package installed next to the already existing firefox.

I tried adding to /Containerfile following RUN commands:

RUN flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

RUN flatpak install flathub com.brave.Browser

After I push this to Github, the actions still work, but booting from my resulting bootc image does not have Brave included.

I looked at common/flatpaks/system-flatpaks.list at ac00d66a23ce1a7e5b55050717d1338c38e5b717 · get-aurora-dev/common · GitHub for my reference/orientation, this seems to indicate to me that it should be possible to define my own preferred flatpak candidates somehow?

Any pointers or even a reference to related documentation would be highly appreciated!

Those flatpak “lists” are used by our ISOs to install them during ISO install.

What you need is (currently) a custom version of flatpak that has the (currently) unreleased preinstall support

look here how we do it with Bazaar flatpak:

Thanks for the reference, it seems I’ll have to wait for this to become generally available..

As a quick side note, I keep Containerfile repos for several distributions, and I also maintain BlueBuild versions.

Both are really useful, but BlueBuild is especially handy for things like Flatpaks, kernel modules, and related pieces.

1 Like

I’m looking at https://github.com/blue-build but I don’t see Containerfiles with example flatpak installations for bootc images. Am I looking at the wrong place?

With Bluebuild you don’t edit a Container file, rather you edit a recipe yaml file which then the Bluebuild Script generates the Container file behind the scenes and then proceeds to build your image.

You start with using their base template:

Once it’s in your repo (and you have added a secret key for the actions like you would any repo). You then edit the recipe.yml file under the recipes folder

For instance, here is a basic one I did:

---
# yaml-language-server: $schema=https://schema.blue-build.org/recipe-v1.json
# image will be published to ghcr.io/<user>/<name>
name: automatic-parakeet-bluebuild
# description will be included in the image's metadata
description: Custom Aurora-DX with bluebuild   

# the base image to build on top of (FROM) and the version tag to use
base-image: ghcr.io/ublue-os/aurora-dx
image-version: stable # latest is also supported if you want new updates ASAP

modules:
 - type: dnf
   install:
     packages:
       - firefox  
       - duperemove 
       - webkit2gtk4.1

 - type: bling
   install:
     - 1password

 - type: signing  # Sets up signature verification properly

This one is pretty simple, it installs firefox and some other packages (I had deleted the firefox flatpak because I wanted the actual packages). The bling section is special scripts they’ve created for specific software that require some additional steps, in that case 1password rpm pulled from the official repo does some additional stuff.

Once you have updated your recipe file, the build action will build the image.

You can reference the Bluebuild documentation for what can go in the yml file. There is a module for kernel modules for example and adding/deleting flatpaks.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.