-
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathContainerfile.in
More file actions
148 lines (129 loc) · 5.82 KB
/
Containerfile.in
File metadata and controls
148 lines (129 loc) · 5.82 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
ARG BASE_IMAGE_ORG="${BASE_IMAGE_ORG}:-quay.io/fedora-ostree-desktops"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}:-kinoite"
ARG BASE_IMAGE="${BASE_IMAGE_ORG}/${BASE_IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}:-43"
ARG AKMODS_FLAVOR="${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION}:-coreos-stable-43"
ARG KERNEL="${KERNEL}:-6.17.12-300.fc43.x86_64"
ARG COMMON_IMAGE="${COMMON_IMAGE}:-ghcr.io/get-aurora-dev/common:latest"
ARG COMMON_IMAGE_SHA=""
ARG BREW_IMAGE="${BREW_IMAGE}:-ghcr.io/ublue-os/brew:latest"
ARG BREW_IMAGE_SHA=""
FROM ${COMMON_IMAGE}@${COMMON_IMAGE_SHA} AS common
FROM ${BREW_IMAGE}@${BREW_IMAGE_SHA} AS brew
FROM ghcr.io/ublue-os/akmods:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION}-${KERNEL} AS akmods
#if defined(NVIDIA)
FROM ghcr.io/ublue-os/akmods-nvidia-open:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION}-${KERNEL} AS akmods-nvidia-open
#endif
#if defined(ZFS)
FROM ghcr.io/ublue-os/akmods-zfs:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION}-${KERNEL} AS akmods-zfs
#endif
FROM scratch AS ctx
COPY /build_files /build_files
# /* https://github.com/get-aurora-dev/common */
COPY --from=common /logos /system_files/shared
COPY --from=common /system_files /system_files
COPY --from=common /wallpapers /system_files/shared
# /* https://github.com/ublue-os/brew */
COPY --from=brew /system_files /system_files/shared
# /* Overwrite files from common if necessary */
COPY /system_files /system_files
# /* aurora image section */
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS base
ARG AKMODS_FLAVOR="main"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION=""
ARG IMAGE_NAME="aurora"
ARG IMAGE_VENDOR="ublue-os"
ARG KERNEL=""
ARG SHA_HEAD_SHORT="dedbeef"
ARG UBLUE_IMAGE_TAG="latest"
ARG VERSION=""
ARG IMAGE_FLAVOR=""
# /* so ghcurl wrapper is available to all later RUNs */
ENV PATH="/tmp/scripts/helpers:${PATH}"
# /* Copy files from common/from system_files */
# /* Install Packages, miscellaneous things that need a network */
# /* aurora:latest no zfs or nvidia */
#if !defined(NVIDIA) && !defined(ZFS)
RUN --mount=type=tmpfs,dst=/boot \
--mount=type=tmpfs,dst=/var \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=bind,from=akmods,src=/kernel-rpms,dst=/tmp/kernel-rpms \
--mount=type=bind,from=akmods,src=/rpms/common,dst=/tmp/rpms/common \
--mount=type=bind,from=akmods,src=/rpms/kmods,dst=/tmp/rpms/kmods \
--mount=type=secret,id=GITHUB_TOKEN \
/ctx/build_files/shared/build.sh && \
/ctx/build_files/base/01-packages.sh && \
/ctx/build_files/base/02-install-common-kernel-akmods.sh && \
/ctx/build_files/base/03-fetch.sh
#endif
# /* aurora:stable with zfs no nvidia */
#if !defined(NVIDIA) && defined(ZFS)
RUN --mount=type=tmpfs,dst=/boot \
--mount=type=tmpfs,dst=/var \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=bind,from=akmods,src=/kernel-rpms,dst=/tmp/kernel-rpms \
--mount=type=bind,from=akmods,src=/rpms/common,dst=/tmp/rpms/common \
--mount=type=bind,from=akmods,src=/rpms/kmods,dst=/tmp/rpms/kmods \
--mount=type=bind,from=akmods-zfs,src=/rpms/kmods/zfs,dst=/tmp/rpms/kmods/zfs \
--mount=type=secret,id=GITHUB_TOKEN \
/ctx/build_files/shared/build.sh && \
/ctx/build_files/base/01-packages.sh && \
/ctx/build_files/base/02-install-common-kernel-akmods.sh && \
/ctx/build_files/base/zfs.sh && \
/ctx/build_files/base/03-fetch.sh
#endif
# /* aurora-nvidia-open:latest no zfs */
#if defined(NVIDIA) && !defined(ZFS)
RUN --mount=type=tmpfs,dst=/boot \
--mount=type=tmpfs,dst=/var \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=bind,from=akmods,src=/kernel-rpms,dst=/tmp/kernel-rpms \
--mount=type=bind,from=akmods,src=/rpms/common,dst=/tmp/rpms/common \
--mount=type=bind,from=akmods,src=/rpms/kmods,dst=/tmp/rpms/kmods \
--mount=type=bind,from=akmods-nvidia-open,src=/rpms,dst=/tmp/rpms/nvidia \
--mount=type=secret,id=GITHUB_TOKEN \
/ctx/build_files/shared/build.sh && \
/ctx/build_files/base/01-packages.sh && \
/ctx/build_files/base/02-install-common-kernel-akmods.sh && \
/ctx/build_files/base/nvidia.sh && \
/ctx/build_files/base/03-fetch.sh
#endif
# /* aurora-nvidia-open:stable with ZFS */
#if defined(NVIDIA) && defined(ZFS)
RUN --mount=type=tmpfs,dst=/boot \
--mount=type=tmpfs,dst=/var \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=bind,from=akmods,src=/kernel-rpms,dst=/tmp/kernel-rpms \
--mount=type=bind,from=akmods,src=/rpms/common,dst=/tmp/rpms/common \
--mount=type=bind,from=akmods,src=/rpms/kmods,dst=/tmp/rpms/kmods \
--mount=type=bind,from=akmods-nvidia-open,src=/rpms,dst=/tmp/rpms/nvidia \
--mount=type=bind,from=akmods-zfs,src=/rpms/kmods/zfs,dst=/tmp/rpms/kmods/zfs \
--mount=type=secret,id=GITHUB_TOKEN \
/ctx/build_files/shared/build.sh && \
/ctx/build_files/base/01-packages.sh && \
/ctx/build_files/base/02-install-common-kernel-akmods.sh && \
/ctx/build_files/base/nvidia.sh && \
/ctx/build_files/base/zfs.sh && \
/ctx/build_files/base/03-fetch.sh
#endif
# /* Everything that can be done offline after things are in place should be done here */
RUN --network=none \
--mount=type=tmpfs,dst=/boot \
--mount=type=tmpfs,dst=/run \
--mount=type=bind,from=ctx,source=/,target=/ctx \
/ctx/build_files/base/16-override-install.sh && \
/ctx/build_files/base/17-cleanup.sh && \
/ctx/build_files/base/18-image-info.sh && \
/ctx/build_files/base/19-initramfs.sh && \
/ctx/build_files/shared/validate-repos.sh && \
/ctx/build_files/shared/clean-stage.sh && \
/ctx/build_files/base/20-tests.sh
CMD ["/sbin/init"]
RUN --network=none \
--mount=type=tmpfs,dst=/run \
bootc container lint