my-ostree-OS/Dockerfile

166 lines
7.1 KiB
Text
Raw Normal View History

2024-12-09 12:53:49 +01:00
FROM fedora:41 AS akmods-builder
2025-02-03 00:45:06 +01:00
ARG KERNEL=kernel-cachyos-lts-lto-skylake
ENV KERNEL=${KERNEL}
# Get list of kernels from CachyOS LTO repo. If the list has been updated, then akmods will be rebuilt. If it hasn't been updated, then caching of the previous build will be used.
2025-02-05 22:18:26 +01:00
ADD "https://copr.fedorainfracloud.org/api_3/build/list?ownername=andersrh&projectname=my-ostree-os&packagename=kernel-cachyos-lts-lto-skylake" /tmp/builds.txt
RUN dnf -y update && dnf -y install wget
2023-07-13 19:35:04 +02:00
RUN dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# Update cachebust in case a rebuild is required without usage of cache.
ARG CACHEBUST=11
RUN cd /etc/yum.repos.d/ && \
wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos-lto/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-lto-fedora-$(rpm -E %fedora).repo && \
wget https://copr.fedorainfracloud.org/coprs/andersrh/kernel-cachyos/repo/fedora-$(rpm -E %fedora)/andersrh-kernel-cachyos-fedora-$(rpm -E %fedora).repo && \
2025-02-03 00:45:06 +01:00
wget https://copr.fedorainfracloud.org/coprs/andersrh/my-ostree-os/repo/fedora-$(rpm -E %fedora)/andersrh-my-ostree-os-fedora-$(rpm -E %fedora).repo && \
wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos-addons/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-addons-fedora-$(rpm -E %fedora).repo && \
cd /tmp
RUN dnf -y install ${KERNEL} ${KERNEL}-devel ${KERNEL}-modules ${KERNEL}-core ${KERNEL}-devel-matched
RUN dnf -y install akmod-nvidia akmod-VirtualBox
COPY akmods.sh /tmp/akmods.sh
RUN /tmp/akmods.sh ${KERNEL}
2023-09-16 11:03:01 +02:00
2024-12-09 12:53:49 +01:00
FROM quay.io/fedora-ostree-desktops/kinoite:41 AS base
2024-09-24 22:08:31 +02:00
2025-02-21 21:25:15 +01:00
ARG CACHEBUST=5
2024-09-24 22:08:31 +02:00
COPY repo/*.repo /etc/yum.repos.d/
# install RPM-fusion
RUN rpm-ostree install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# 32-bit dependencies for the Nvidia driver.
RUN rpm-ostree install glibc.i686
# install nonfree codecs
RUN rpm-ostree override remove libavcodec-free libavfilter-free libavformat-free libavutil-free libpostproc-free libswresample-free libswscale-free libavdevice-free ffmpeg-free --install libavcodec-freeworld
# Install HEIC support for Gwenview and Dolphin (and potentially other applications)
RUN rpm-ostree install libheif-freeworld
# Mesa clang
2025-02-23 02:13:44 +01:00
RUN rpm-ostree override replace --experimental --from repo=copr:copr.fedorainfracloud.org:andersrh:mesa-24 mesa-filesystem mesa-libglapi mesa-dri-drivers mesa-libgbm mesa-libEGL mesa-libGL mesa-vulkan-drivers mesa-libxatracker mesa-vdpau-drivers mesa-libOSMesa mesa-libOpenCL mesa-va-drivers
2024-09-24 22:08:31 +02:00
# 32-bit dependencies for the Nvidia driver.
2025-02-23 02:13:44 +01:00
RUN rpm-ostree override replace --experimental --from repo=copr:copr.fedorainfracloud.org:andersrh:mesa-24:ml mesa-dri-drivers.i686
2024-09-26 23:31:47 +02:00
RUN rpm-ostree install mesa-filesystem.i686 mesa-libEGL.i686 mesa-libGL.i686 mesa-libgbm.i686 mesa-libglapi.i686 mesa-vulkan-drivers.i686
2024-09-24 22:08:31 +02:00
RUN rpm-ostree install ffmpeg ffmpeg-libs libavdevice intel-media-driver pipewire-codec-aptx libva-intel-driver libva-utils
FROM base AS kernel
2025-02-03 00:45:06 +01:00
ARG KERNEL=kernel-cachyos-lts-lto-skylake
ENV KERNEL=${KERNEL}
2024-09-24 22:08:31 +02:00
RUN mkdir /tmp/nvidia
COPY install-nvidia.sh /tmp/install-nvidia.sh
COPY --from=akmods-builder /var/cache/akmods/*/* /tmp/nvidia
2025-02-03 00:45:06 +01:00
RUN cd /etc/yum.repos.d/ && wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos-addons/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-addons-fedora-$(rpm -E %fedora).repo && \
wget https://copr.fedorainfracloud.org/coprs/andersrh/my-ostree-os/repo/fedora-$(rpm -E %fedora)/andersrh-my-ostree-os-fedora-$(rpm -E %fedora).repo
2024-09-24 22:08:31 +02:00
RUN cd /etc/yum.repos.d/ && \
wget https://copr.fedorainfracloud.org/coprs/andersrh/kernel-cachyos/repo/fedora-$(rpm -E %fedora)/andersrh-kernel-cachyos-fedora-$(rpm -E %fedora).repo && \
wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos-lto/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-lto-fedora-$(rpm -E %fedora).repo && \
cd /tmp
2024-09-26 23:31:47 +02:00
# install binutils to get strip command
RUN rpm-ostree install binutils
2024-09-24 22:08:31 +02:00
COPY install_cachyos_kernel.sh /tmp
# Enable cliwrap.
RUN rpm-ostree cliwrap install-to-root / && \
# Replace the kernel, kernel-core and kernel-modules packages.
/tmp/install_cachyos_kernel.sh ${KERNEL}
2024-09-24 22:08:31 +02:00
# install akmods
RUN ls /tmp/nvidia && /tmp/install-nvidia.sh ${KERNEL}
2024-09-24 22:08:31 +02:00
RUN rpm-ostree install \
xorg-x11-drv-nvidia{,-cuda,-devel,-kmodsrc} \
xorg-x11-drv-nvidia-libs.i686 \
nvidia-container-toolkit supergfxctl supergfxctl-plasmoid
RUN mv /etc/nvidia-container-runtime/config.toml{,.orig}
RUN systemctl enable supergfxd.service
RUN rpm-ostree uninstall xorg-x11-drv-nvidia-power
# install Nvidia software
RUN rpm-ostree install nvidia-vaapi-driver nvidia-persistenced opencl-filesystem
# Clear cache, /var and /tmp and commit ostree
RUN rm -rf /tmp/* /var/* && mkdir -p /var/tmp && chmod -R 1777 /var/tmp && \
ostree container commit
FROM kernel AS os
2023-07-13 19:35:04 +02:00
2024-09-02 18:14:57 +02:00
ARG CACHEBUST=5
2023-07-13 19:35:04 +02:00
2024-08-20 10:13:48 +02:00
RUN cd /tmp && \
2024-08-24 12:57:34 +02:00
rpm-ostree cleanup -m && rpm-ostree install ksshaskpass cronie distrobox fish lld nvtop seadrive-gui pulseaudio-utils hfsplus-tools VirtualBox
2023-09-25 18:08:51 +02:00
# Add podman-compose dependency for "podman compose" command
RUN rpm-ostree install podman-compose
2023-11-09 14:44:17 +01:00
2023-12-16 17:29:50 +01:00
# Disable SELinux
RUN sed -i "s/^SELINUX=.*$/SELINUX=permissive/g" /etc/sysconfig/selinux && sed -i "s/^SELINUX=.*$/SELINUX=permissive/g" /etc/selinux/config
# Xwayland clang
2024-09-01 15:08:11 +02:00
RUN rpm-ostree override replace --experimental --from repo=copr:copr.fedorainfracloud.org:andersrh:my-ostree-os xorg-x11-server-Xwayland
# add Haruna media player to host for better VAAPI performance
RUN rpm-ostree install haruna
2024-01-14 16:29:29 +01:00
# Install AppImageLauncher
RUN rpm-ostree install https://github.com/TheAssassin/AppImageLauncher/releases/download/v2.2.0/appimagelauncher-2.2.0-travis995.0f91801.x86_64.rpm
2024-01-14 16:29:29 +01:00
# Install Gwenview on host for full support for image formats such as HEIC
RUN rpm-ostree install gwenview
# add cachyos-settings and scx-scheds
RUN rpm-ostree install scx-scheds
2024-08-24 12:22:57 +02:00
RUN rpm-ostree override remove zram-generator-defaults --install cachyos-settings
2024-10-04 13:56:20 +02:00
# Install Waydroid
RUN rpm-ostree install waydroid
2024-11-16 22:46:14 +01:00
# Install virt-manager and LXC driver
RUN rpm-ostree install virt-manager libvirt-daemon-driver-lxc libvirt-daemon-lxc
2024-12-12 11:23:44 +01:00
# Install VDO tools and Bees
RUN rpm-ostree install vdo bees
2024-12-14 15:19:17 +01:00
# Install ZFS
RUN rpm -e --nodeps zfs-fuse && rpm-ostree install https://zfsonlinux.org/fedora/zfs-release-2-6$(rpm --eval "%{dist}").noarch.rpm && rpm-ostree install ${KERNEL}-devel ${KERNEL}-devel-matched && rpm-ostree install zfs --uninstall zfs-fuse
2024-12-14 19:29:31 +01:00
# Build ZFS module manually
RUN dkms install zfs/$(ls /usr/src/ | grep zfs- | cut -d- -f2-) -k $(rpm -q --queryformat "%{VERSION}-%{RELEASE}.%{ARCH}\n" ${KERNEL})
2024-12-14 15:19:17 +01:00
2025-02-14 08:42:47 +01:00
# Install Gnome Boxes
RUN rpm-ostree install gnome-boxes
# enable scx service
RUN systemctl enable scx.service
2024-08-24 12:33:56 +02:00
2023-09-25 18:08:51 +02:00
# Copy config files
COPY etc /etc
# Copy /usr
COPY usr /usr
2023-09-25 18:08:51 +02:00
2023-12-16 20:37:26 +01:00
# Enable /nix mount service
RUN systemctl enable mount-nix-prepare.service
# Clear cache, /var and /tmp and commit ostree
RUN rm -rf /tmp/* /var/* && mkdir -p /var/tmp && chmod -R 1777 /var/tmp && \
ostree container commit