-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile-nvidia
83 lines (73 loc) · 3.23 KB
/
Containerfile-nvidia
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Main arguments
ARG GABLUE_VARIANT="nvidia"
ARG SOURCE_IMAGE="kinoite"
ARG SOURCE_SUFFIX="-main"
ARG SOURCE_TAG="41"
ARG FEDORA_MAJOR_VERSION="41"
ARG KERNEL_TYPE="bazzite"
ARG KERNEL_VERSION="6.12.8-201"
# Import main packages
FROM ghcr.io/ublue-os/${KERNEL_TYPE}-kernel:${KERNEL_VERSION}.${KERNEL_TYPE}.fc${FEDORA_MAJOR_VERSION}.x86_64 AS kernel
FROM ghcr.io/ublue-os/akmods:${KERNEL_TYPE}-${FEDORA_MAJOR_VERSION}-${KERNEL_VERSION}.${KERNEL_TYPE}.fc${FEDORA_MAJOR_VERSION}.x86_64 AS akmods
FROM ghcr.io/ublue-os/akmods-extra:${KERNEL_TYPE}-${FEDORA_MAJOR_VERSION}-${KERNEL_VERSION}.${KERNEL_TYPE}.fc${FEDORA_MAJOR_VERSION}.x86_64 AS akmods-extra
FROM ghcr.io/ublue-os/akmods-nvidia:${KERNEL_TYPE}-${FEDORA_MAJOR_VERSION}-${KERNEL_VERSION}.${KERNEL_TYPE}.fc${FEDORA_MAJOR_VERSION}.x86_64 AS akmods-nvidia
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG}
# Copy files
COPY files/system/all /
COPY files/system/kinoite /
COPY files/system/nvidia /
RUN chmod +x /usr/libexec/containerbuild/*.sh
# Set environnement variables for scripts
ENV GABLUE_VARIANT="nvidia"
ENV SOURCE_IMAGE="kinoite"
ENV SOURCE_SUFFIX="-main"
ENV SOURCE_TAG="41"
ENV FEDORA_MAJOR_VERSION="41"
ENV OS_VERSION="41"
# Update packages that commonly cause build issues
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
/usr/libexec/containerbuild/update-pkgs.sh && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Setup copr repos
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
/usr/libexec/containerbuild/copr.sh && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Install kernel-
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=kernel,src=/tmp/rpms,dst=/tmp/kernel-rpms \
/usr/libexec/containerbuild/kernel.sh && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Add ublue packages
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=akmods,src=/rpms,dst=/tmp/akmods-rpms \
--mount=type=bind,from=akmods-extra,src=/rpms,dst=/tmp/akmods-extra-rpms \
/usr/libexec/containerbuild/akmods.sh && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Install nvidia driver
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=akmods-nvidia,src=/rpms,dst=/tmp/akmods-rpms \
/usr/libexec/containerbuild/nvidia.sh && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Install rpm
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
mkdir -p /var/lib/alternatives && \
/usr/libexec/containerbuild/ublue-update.sh && \
/usr/libexec/containerbuild/rpm.sh && \
mv /var/lib/alternatives /staged-alternatives && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Post-install
RUN mkdir -p /var/tmp && chmod 1777 /var/tmp && \
/usr/libexec/containerbuild/systemd.sh && \
/usr/libexec/containerbuild/post-install.sh && \
/usr/libexec/containerbuild/initramfs.sh && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit && \
mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives && \
mkdir -p /var/tmp && chmod 1777 /var/tmp && \
rm -rf /usr/libexec/containerbuild