From 095621b7ab4aa23a5efbcaab9b1f9fdbbeb07862 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 2 Dec 2024 22:41:11 -0500 Subject: [PATCH 1/6] feat: switch to bootc/dnf5 --- Containerfile | 79 +++++++++++++-------------------------------------- build.sh | 23 --------------- 2 files changed, 20 insertions(+), 82 deletions(-) delete mode 100755 build.sh diff --git a/Containerfile b/Containerfile index 5d08ad5e..cb1ddb47 100644 --- a/Containerfile +++ b/Containerfile @@ -1,59 +1,20 @@ -## 1. BUILD ARGS -# These allow changing the produced image by passing different build args to adjust -# the source from which your image is built. -# Build args can be provided on the commandline when building locally with: -# podman build -f Containerfile --build-arg FEDORA_VERSION=40 -t local-image - -# SOURCE_IMAGE arg can be anything from ublue upstream which matches your desired version: -# See list here: https://github.com/orgs/ublue-os/packages?repo_name=main -# - "silverblue" -# - "kinoite" -# - "sericea" -# - "onyx" -# - "lazurite" -# - "vauxite" -# - "base" -# -# "aurora", "bazzite", "bluefin" or "ucore" may also be used but have different suffixes. -ARG SOURCE_IMAGE="silverblue" - -## SOURCE_SUFFIX arg should include a hyphen and the appropriate suffix name -# These examples all work for silverblue/kinoite/sericea/onyx/lazurite/vauxite/base -# - "-main" -# - "-nvidia" -# - "-asus" -# - "-asus-nvidia" -# - "-surface" -# - "-surface-nvidia" -# -# aurora, bazzite and bluefin each have unique suffixes. Please check the specific image. -# ucore has the following possible suffixes -# - stable -# - stable-nvidia -# - stable-zfs -# - stable-nvidia-zfs -# - (and the above with testing rather than stable) -ARG SOURCE_SUFFIX="-main" - -## SOURCE_TAG arg must be a version built for the specific image: eg, 39, 40, gts, latest -ARG SOURCE_TAG="latest" - - -### 2. SOURCE IMAGE -## this is a standard Containerfile FROM using the build ARGs above to select the right upstream image -FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG} - - -### 3. MODIFICATIONS -## make modifications desired in your image and install packages by modifying the build.sh script -## the following RUN directive does all the things required to run "build.sh" as recommended. - -COPY build.sh /tmp/build.sh - -RUN mkdir -p /var/lib/alternatives && \ - /tmp/build.sh && \ - ostree container commit -## NOTES: -# - /var/lib/alternatives is required to prevent failure with some RPM installs -# - All RUN commands must end with ostree container commit -# see: https://coreos.github.io/rpm-ostree/container/#using-ostree-container-commit +FROM ghcr.io/ublue-os/base-main:latest + +## Nvidia users use this instead +# FROM ghcr.io/ublue-os/base-nvidia:latest + + +## Install a Desktop + +RUN dnf5 group install kde-desktop kde-apps + +## Install applications +# Anything in Fedora + +RUN dnf5 install vlc + +## Add COPRs +# RUN dnf copr enable (copr-author/name) + +## Manage services +# systemctl enable foo.service \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index 0ca16785..00000000 --- a/build.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -ouex pipefail - -RELEASE="$(rpm -E %fedora)" - - -### Install packages - -# Packages can be installed from any enabled yum repo on the image. -# RPMfusion repos are available by default in ublue main images -# List of rpmfusion packages can be found here: -# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1 - -# this installs a package from fedora repos -rpm-ostree install screen - -# this would install a package from rpmfusion -# rpm-ostree install vlc - -#### Example for enabling a System Unit File - -systemctl enable podman.socket From 5efe384e8fab33ebf10188c242a9de44a097dbcb Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 2 Dec 2024 22:50:53 -0500 Subject: [PATCH 2/6] docs: update readme --- Containerfile | 1 + README.md | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Containerfile b/Containerfile index cb1ddb47..ceb11bca 100644 --- a/Containerfile +++ b/Containerfile @@ -5,6 +5,7 @@ FROM ghcr.io/ublue-os/base-main:latest ## Install a Desktop +# Use `dnf5 group list` to see possible group packages to install, or choose them individually RUN dnf5 group install kde-desktop kde-apps diff --git a/README.md b/README.md index bfb9e866..d2a92f68 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,7 @@ # Purpose -This repository is meant to be a template for building your own custom Universal Blue image. This template is the recommended way to make customizations to any image published by the Universal Blue Project: -- [Aurora](https://getaurora.dev/) -- [Bazzite](https://bazzite.gg/) -- [Bluefin](https://projectbluefin.io/) -- [uCore](https://projectucore.io/) -- [main](https://github.com/ublue-os/main/) -- [hwe](https://github.com/ublue-os/hwe/) - -This template includes a Containerfile and a Github workflow for building the container image. As soon as the workflow is enabled in your repository, it will build the container image and push it to the Github Container Registry. +This repository is meant to be a template for building your own custom Universal Blue image. # Prerequisites @@ -19,8 +11,8 @@ Working knowledge in the following topics: - Containers - https://www.youtube.com/watch?v=SnSH8Ht3MIc - https://www.mankier.com/5/Containerfile -- rpm-ostree - - https://coreos.github.io/rpm-ostree/container/ +- bootc + - https://containers.github.io/bootc/ - Fedora Silverblue (and other Fedora Atomic variants) - https://docs.fedoraproject.org/en-US/fedora-silverblue/ - Github Workflows @@ -34,10 +26,19 @@ Select `Use this Template` and create a new repository from it. To enable the wo ## Containerfile -This file defines the operations used to customize the selected image. It contains examples of possible modifications, including how to: -- change the upstream from which the custom image is derived -- add additional RPM packages -- add binaries as a layer from other images +The top line is the base image you want to start FROM. Any valid image can be a starting point, examples include: + +`FROM ghcr.io/ublue-os/bazzite:latest` +`FROM ghcr.io/ublue-os/bluefin:stable` +`FROM ghcr.io/ublue-os/aurora-dx:stable` + +## "Emtpy base images" + +These contain a base system WITHOUT a prexisting desktop. This is recommended for + +`FROM ghcr.io/ublue-os/base-main:latest` + +Use `base-nvidia:latest` if you need the Nvidia drivers. You can also lock to a specific version like `base-nvidia:41`, etc. ## Workflows From 1629313b1cb251f1f454f7997404a7c14e8c60da Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 2 Dec 2024 22:55:11 -0500 Subject: [PATCH 3/6] fix: typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2a92f68..079b55e0 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ The top line is the base image you want to start FROM. Any valid image can be a `FROM ghcr.io/ublue-os/bluefin:stable` `FROM ghcr.io/ublue-os/aurora-dx:stable` -## "Emtpy base images" +## "Empty" base images -These contain a base system WITHOUT a prexisting desktop. This is recommended for +These contain a base system WITHOUT a pre-existing desktop. This is recommended for a more bottom up approach or if you want to to use a different desktop environment than is currently available: `FROM ghcr.io/ublue-os/base-main:latest` From bdaae27b70319efe666ae6c307aab9217fc26a8d Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 2 Dec 2024 22:59:13 -0500 Subject: [PATCH 4/6] docs: fix whitespace --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 079b55e0..0675f62d 100644 --- a/README.md +++ b/README.md @@ -28,15 +28,15 @@ Select `Use this Template` and create a new repository from it. To enable the wo The top line is the base image you want to start FROM. Any valid image can be a starting point, examples include: -`FROM ghcr.io/ublue-os/bazzite:latest` -`FROM ghcr.io/ublue-os/bluefin:stable` -`FROM ghcr.io/ublue-os/aurora-dx:stable` +- `FROM ghcr.io/ublue-os/bazzite:latest` +- `FROM ghcr.io/ublue-os/bluefin:stable` +- `FROM ghcr.io/ublue-os/aurora-dx:stable` ## "Empty" base images These contain a base system WITHOUT a pre-existing desktop. This is recommended for a more bottom up approach or if you want to to use a different desktop environment than is currently available: -`FROM ghcr.io/ublue-os/base-main:latest` +- `FROM ghcr.io/ublue-os/base-main:latest` Use `base-nvidia:latest` if you need the Nvidia drivers. You can also lock to a specific version like `base-nvidia:41`, etc. From 85054f7636b97ef94deeb6d77dd511db4a094128 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Mon, 2 Dec 2024 23:01:57 -0500 Subject: [PATCH 5/6] fix: add copr example --- Containerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index ceb11bca..f35bd79d 100644 --- a/Containerfile +++ b/Containerfile @@ -16,6 +16,7 @@ RUN dnf5 install vlc ## Add COPRs # RUN dnf copr enable (copr-author/name) +# RUN dnf5 install thing-from-copr ## Manage services -# systemctl enable foo.service \ No newline at end of file +# systemctl enable foo.service From 444355891052c8e94054a6d2dff183ab0560df14 Mon Sep 17 00:00:00 2001 From: "Jorge O. Castro" Date: Sat, 14 Dec 2024 21:19:29 -0500 Subject: [PATCH 6/6] fix: add container lint --- Containerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Containerfile b/Containerfile index f35bd79d..b2b91982 100644 --- a/Containerfile +++ b/Containerfile @@ -20,3 +20,6 @@ RUN dnf5 install vlc ## Manage services # systemctl enable foo.service + +## Final command +RUN bootc container lint