-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile-nvidia-open
75 lines (65 loc) · 2.58 KB
/
Containerfile-nvidia-open
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
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.13.5-102"
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-open:${KERNEL_TYPE}-${FEDORA_MAJOR_VERSION}-${KERNEL_VERSION}.${KERNEL_TYPE}.fc${FEDORA_MAJOR_VERSION}.x86_64 AS nvidia-akmods
FROM scratch AS ctx
COPY files/scripts /
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 /
# 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"
# Setup copr repos
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
sh /ctx/copr && \
sh /ctx/cleanup
# Install kernel
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=akmods,src=/kernel-rpms,dst=/tmp/kernel-rpms \
--mount=type=bind,from=akmods,src=/rpms,dst=/tmp/akmods-rpms \
--mount=type=bind,from=akmods-extra,src=/rpms,dst=/tmp/akmods-extra-rpms \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
sh /ctx/kernel && \
sh /ctx/cleanup
# Install nvidia driver
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=nvidia-akmods,src=/rpms,dst=/tmp/akmods-rpms \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
sh /ctx/nvidia && \
sh /ctx/cleanup
# Install rpm
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
sh /ctx/rpm && \
sh /ctx/cleanup
# Post-install
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
sh /ctx/systemd && \
sh /ctx/post-install && \
sh /ctx/initramfs && \
sh /ctx/finalize