-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
335 lines (314 loc) · 11.9 KB
/
Containerfile
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}"
ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-$BASE_IMAGE_NAME}"
ARG BASE_IMAGE="quay.io/fedora-ostree-desktops/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-41}"
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS quark
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}"
ARG IMAGE_NAME="${IMAGE_NAME:-quark}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR}"
ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-41}"
COPY system_files /
COPY --from=ghcr.io/ublue-os/config:latest /rpms /tmp/rpms/config
# Update packages
RUN dnf5 -y upgrade
# Setup repos and ublue-os config rpms
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
wget https://github.com/trgeiger/cpm/releases/download/v1.0.3/cpm -O /usr/bin/cpm && chmod +x /usr/bin/cpm && \
cpm enable \
che/nerd-fonts \
kylegospo/bazzite \
ublue-os/staging \
sentry/switcheroo-control_discrete \
bieszczaders/kernel-cachyos \
bieszczaders/kernel-cachyos-addons && \
rm -rf /tmp/rpms/config/ublue-os-update-services.*.rpm && \
dnf5 -y install \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm \
/tmp/rpms/config/*.rpm \
fedora-repos-archive && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Install CachyOS kernel
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
rpm-ostree cliwrap install-to-root / && \
rpm-ostree override remove \
kernel \
kernel-core \
kernel-modules \
kernel-modules-core \
kernel-modules-extra \
--install \
kernel-cachyos \
--install \
kernel-cachyos-devel-matched && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Removals
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
dnf5 -y remove \
google-noto-sans-cjk-vf-fonts \
mesa-va-drivers \
default-fonts-cjk-sans \
firefox \
firefox-langpacks && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Additions and swaps
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
dnf5 -y swap \
ffmpeg-free ffmpeg --allowerasing && \
dnf5 -y install \
adw-gtk3-theme \
alsa-firmware \
apr \
apr-util \
bootc \
cascadia-code-fonts \
cachyos-settings \
default-fonts-cjk-sans \
distrobox \
drm_info \
duperemove \
edid-decode \
fastfetch \
#ffmpeg \
ffmpegthumbnailer \
fuse-libs \
fzf \
glibc.i686 \
google-noto-sans-balinese-fonts \
google-noto-sans-cjk-fonts \
google-noto-sans-javanese-fonts \
google-noto-sans-sundanese-fonts \
grub2-tools-extra \
htop \
i2c-tools \
jetbrains-mono-fonts \
jq \
just \
kernel-tools \
libheif \
libratbag-ratbagd \
libva \
libva-intel-media-driver \
lshw \
mesa-libGLU \
mpv \
nerd-fonts \
net-tools \
nvme-cli \
nvtop \
openrgb-udev-rules \
openssl \
pam_yubico \
pam-u2f \
pamu2fcfg \
patch \
powertop \
python3-pip \
rsms-inter-fonts \
scx-scheds \
setools \
smartmontools \
solaar-udev \
symlinks \
sysfsutils \
tcpdump \
tmux \
traceroute \
tuned \
tuned-gtk \
tuned-ppd \
tuned-profiles-cpu-partitioning \
tuned-utils \
unrar \
vim \
vulkan-tools \
wireguard-tools \
wl-clipboard \
x265 \
xrandr \
zsh \
zstd && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/mpv.desktop && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Desktop environment stuff
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
if [[ "${BASE_IMAGE_NAME}" == "silverblue" ]]; then \
dnf5 -y upgrade --repo copr:copr.fedorainfracloud.org:ublue-os:staging \
gnome-shell && \
dnf5 -y upgrade --repo tayler \
mutter \
mutter-common && \
dnf5 -y install \
gnome-randr-rust \
gnome-epub-thumbnailer \
gnome-tweaks \
gnome-shell-extension-blur-my-shell \
gnome-shell-extension-caffeine \
gnome-shell-extension-just-perfection \
gnome-shell-extension-hotedge && \
dnf5 -y remove \
gnome-tour \
gnome-extensions-app \
gnome-classic-session \
gnome-shell-extension-background-logo \
gnome-shell-extension-apps-menu && \
dnf5 -y upgrade --repo copr:copr.fedorainfracloud.org:sentry:switcheroo-control_discrete \
switcheroo-control && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit \
; elif [[ "${BASE_IMAGE_NAME}" == "kinoite" ]]; then \
dnf5 -y install \
qt \
kdeplasma-addons && \
dnf5 -y remove \
plasma-welcome \
plasma-welcome-fedora && \
dnf5 -y upgrade --repo tayler \
qt6-qtbase \
; fi
# Gaming-specific changes
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
if [[ "${IMAGE_NAME}" != "quark-cloud-dev" ]]; then \
cpm enable ilyaz/LACT && \
dnf5 -y install \
lact-libadwaita \
jupiter-sd-mounting-btrfs \
at-spi2-core.i686 \
atk.i686 \
vulkan-loader.i686 \
alsa-lib.i686 \
fontconfig.i686 \
gtk2.i686 \
libICE.i686 \
libnsl.i686 \
libxcrypt-compat.i686 \
libpng12.i686 \
libXext.i686 \
libXinerama.i686 \
libXtst.i686 \
libXScrnSaver.i686 \
NetworkManager-libnm.i686 \
nss.i686 \
pulseaudio-libs.i686 \
libcurl.i686 \
systemd-libs.i686 \
libva.i686 \
libvdpau.i686 \
libdbusmenu-gtk3.i686 \
libatomic.i686 \
pipewire-alsa.i686 \
gobject-introspection \
clinfo \
steam \
wine-core.x86_64 \
wine-core.i686 \
wine-pulseaudio.x86_64 \
wine-pulseaudio.i686 \
libFAudio.x86_64 \
libFAudio.i686 \
winetricks \
mesa-vulkan-drivers.i686 \
mesa-va-drivers.i686 \
gamescope \
vkBasalt.x86_64 \
vkBasalt.i686 \
mangohud.x86_64 \
mangohud.i686 \
protontricks \
intel-undervolt && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/yad-icon-browser.desktop && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/winetricks.desktop && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/protontricks.desktop && \
systemctl enable lactd && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit \
; fi
# run post-install tasks and clean up
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
mkdir -p /var/tmp && chmod 1777 /var/tmp && \
rm -f /etc/pki/akmods/private/private_key.priv && \
rm -f /etc/pki/akmods/certs/public_key.der && \
rm -f /usr/share/vulkan/icd.d/lvp_icd.*.json && \
rm -f /usr/share/applications/htop.desktop && \
rm -f /usr/share/applications/nvtop.desktop && \
rm -f /usr/share/applications/shredder.desktop && \
mkdir -p /usr/etc/flatpak/remotes.d && \
wget -q https://dl.flathub.org/repo/flathub.flatpakrepo -P /usr/etc/flatpak/remotes.d && \
sed -i 's@Name=tuned-gui@Name=TuneD Manager@g' /usr/share/applications/tuned-gui.desktop && \
curl -Lo /tmp/starship.tar.gz "https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz" && \
tar -xzf /tmp/starship.tar.gz -C /tmp && \
install -c -m 0755 /tmp/starship /usr/bin && \
echo 'eval "$(starship init bash)"' >> /etc/bashrc && \
echo 'eval "$(starship init zsh)"' >> /etc/zshrc && \
systemctl enable tuned.service && \
systemctl enable dconf-update.service && \
systemctl disable rpm-ostreed-automatic.timer && \
systemctl --global enable podman.socket && \
systemctl --global enable systemd-tmpfiles-setup.service && \
echo "import \"/usr/share/ublue-os/just/80-quark.just\"" >> /usr/share/ublue-os/justfile && \
sed -i '/^PRETTY_NAME/s/Silverblue/Quark/' /usr/lib/os-release && \
sed -i 's/^NAME=.*/NAME="Quark"/' /usr/lib/os-release && \
fc-cache --system-only --really-force --verbose && \
/usr/libexec/containerbuild/image-info && \
/usr/libexec/containerbuild/build-initramfs && \
/usr/libexec/containerbuild/cleanup.sh && \
mkdir -p /var/tmp && chmod 1777 /var/tmp && \
ostree container commit
# cloud development build
FROM quark as quark-cloud-dev
ARG IMAGE_NAME="${IMAGE_NAME:-quark-cloud-dev}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR}"
ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
# Install Openshift tools -- oc, opm, kubectl, operator-sdk, odo, helm, crc
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
export VER=$(curl --silent -qI https://github.com/operator-framework/operator-sdk/releases/latest | \
awk -F '/' '/^location/ {print substr($NF, 1, length($NF)-1)}') && \
wget https://github.com/operator-framework/operator-sdk/releases/download/$VER/operator-sdk_linux_amd64 -O /usr/bin/operator-sdk && \
chmod +x /usr/bin/operator-sdk && \
curl -SL https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz | tar xvzf - -C /usr/bin && \
curl -SL https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/opm-linux.tar.gz | tar xvzf - -C /usr/bin && \
curl -SL https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/helm/latest/helm-linux-amd64 -o /usr/bin/helm && chmod +x /usr/bin/helm && \
curl -SL https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/odo/latest/odo-linux-amd64 -o /usr/bin/odo && chmod +x /usr/bin/odo && \
curl -SL https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/crc/latest/crc-linux-amd64.tar.xz | tar xfJ - --strip-components 1 -C /usr/bin && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Install Kind
RUN curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/latest/download/kind-$(uname)-amd64" && \
chmod +x ./kind && \
mv ./kind /usr/bin/kind && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
# Install awscli
RUN curl -SL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip && \
unzip awscliv2.zip && \
./aws/install --bin-dir /usr/bin --install-dir /usr/bin && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
RUN echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo && rpm --import https://packages.microsoft.com/keys/microsoft.asc && \
dnf5 -y install \
code \
make \
qemu \
libvirt \
virt-manager && \
rm -f /var/lib/unbound/root.key && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit
RUN cpm remove --all && \
rm -f get_helm.sh && \
rm -rf aws && \
rm -f awscliv2.zip && \
rm -f /usr/bin/README.md && \
rm -f /usr/bin/LICENSE && \
sed -i '/^PRETTY_NAME/s/Quark/Quark Cloud Dev/' /usr/lib/os-release && \
sed -i 's/^NAME=.*/NAME="Quark Cloud Dev"/' /usr/lib/os-release && \
/usr/libexec/containerbuild/cleanup.sh && \
ostree container commit