summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gospodnetich <me@kylegospodneti.ch>2024-04-14 22:27:36 -0700
committerGitHub <noreply@github.com>2024-04-15 00:27:36 -0500
commite617e14dd0db5eb05613506cd37e0bef948f4f9d (patch)
tree0ad12fda7cbe590413e6fe87da9ccb5484c3fa6b
parentf248afd48be0b48153b3aeb1e79b1001541aa44c (diff)
downloadAeroCore-OS-e617e14dd0db5eb05613506cd37e0bef948f4f9d.tar.gz
AeroCore-OS-e617e14dd0db5eb05613506cd37e0bef948f4f9d.zip
fix: clarify ostree container commit must be used (#4)
* fix: clarify ostree container commit must be used after each RUN * chore: use a bash script and simplify Containerfile --------- Co-authored-by: Benjamin Sherman <benjamin@holyarmy.org>
-rw-r--r--Containerfile52
-rwxr-xr-xbuild.sh27
2 files changed, 40 insertions, 39 deletions
diff --git a/Containerfile b/Containerfile
index da1dad9..b4cbcce 100644
--- a/Containerfile
+++ b/Containerfile
@@ -44,42 +44,16 @@ ARG FEDORA_VERSION="39"
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${FEDORA_VERSION}
-### 3. PRE-MODIFICATIONS
-## This section is meant for any modifications to the image before the main modifications are made.
-
-## this directory is needed to prevent failure with some RPM installs
-RUN mkdir -p /var/lib/alternatives
-
-
-### 4. MODIFICATIONS
-## make modifications desired in your image and install packages here, a few examples follow
-
-#### Install packages
-
-# install a package from standard fedora repo or rpmfusion repo
-# RPMfusion packages 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
-RUN rpm-ostree install screen
-# example package from rpmfusion
-#RUN rpm-ostree install vlc
-
-#### Installation of static binaries
-
-# static binaries can sometimes by added using a COPY directive like these below.
-COPY --from=cgr.dev/chainguard/kubectl:latest /usr/bin/kubectl /usr/bin/kubectl
-#COPY --from=docker.io/docker/compose-bin:latest /docker-compose /usr/bin/docker-compose
-
-#### Change to System Configuration Files
-
-# modify default timeouts on system to prevent slow reboots from services that won't stop
-RUN sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/user.conf && \
- sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/system.conf
-
-
-### 5. POST-MODIFICATIONS
-## these commands leave the image in a clean state after local modifications
-RUN rm -rf /tmp/* /var/* && \
- ostree container commit && \
- mkdir -p /tmp /var/tmp && \
- chmod 1777 /tmp /var/tmp
+### 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
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..d5fb95d
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+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
+#RUN rpm-ostree install vlc
+
+
+
+#### Change to System Configuration Files
+
+# this example modifies default timeouts to prevent slow reboots from services that won't stop
+sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/user.conf
+sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/system.conf