-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
300 lines (281 loc) · 6.84 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
# Build box first, then gaming-box
FROM quay.io/toolbx/arch-toolbox AS box
# Pacman Initialization
# Create build user
RUN sed -i 's/#Color/Color/g' /etc/pacman.conf && \
printf "[multilib]\nInclude = /etc/pacman.d/mirrorlist\n" | tee -a /etc/pacman.conf && \
sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$(nproc)"/g' /etc/makepkg.conf && \
pacman-key --init && pacman-key --populate && \
pacman -Syu --noconfirm && \
useradd -m --shell=/bin/bash build && usermod -L build && \
echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
pacman -S --clean --clean
# git & base-devel
RUN pacman -S --needed \
git \
base-devel \
wget \
--noconfirm
# Distrobox integration
RUN git clone https://github.com/89luca89/distrobox.git --single-branch /tmp/distrobox && \
cp /tmp/distrobox/distrobox-host-exec /usr/bin/distrobox-host-exec && \
ln -s /usr/bin/distrobox-host-exec /usr/bin/flatpak && \
wget https://github.com/1player/host-spawn/releases/download/$(cat /tmp/distrobox/distrobox-host-exec | grep host_spawn_version= | cut -d "\"" -f 2)/host-spawn-$(uname -m) -O /usr/bin/host-spawn && \
chmod +x /usr/bin/host-spawn && \
rm -drf /tmp/distrobox
# Installation
RUN pacman -S --needed \
## Speed up first launch
adw-gtk-theme \
bash-completion \
bc \
cage \
curl \
diffutils \
electron \
findutils \
glibc \
glibc-locales \
gnupg \
inetutils \
keyutils \
less \
lsof \
man-db \
man-pages \
mlocate \
mtr \
ncurses \
nss-mdns \
openssh \
pigz \
pinentry \
procps-ng \
rust \
rsync \
shadow \
sudo \
tcpdump \
time \
traceroute \
tree \
tzdata \
unrar \
unzip \
util-linux \
util-linux-libs \
vte-common \
words \
xorg-xauth \
zenity \
zip \
# Graphics
intel-media-driver \
lib32-vulkan-icd-loader \
lib32-vulkan-mesa-layers \
libva-intel-driver \
libva-mesa-driver \
libva-utils \
mesa \
opengl-driver \
vulkan-icd-loader \
vulkan-intel \
vulkan-mesa-layers \
vulkan-radeon \
lib32-vulkan-radeon \
vulkan-tools \
# Sound
lib32-libnm \
openal \
pipewire \
pipewire-alsa \
pipewire-jack \
pipewire-pulse \
wireplumber \
lib32-pipewire \
lib32-pipewire-jack \
lib32-libpulse \
lib32-openal \
# Desktop Integration
libnotify \
xdg-desktop-portal \
xdg-desktop-portal-gnome \
xdg-desktop-portal-gtk \
xdg-utils \
xorg-xeyes \
# Fonts
adobe-source-han-sans-otc-fonts \
adobe-source-han-serif-otc-fonts \
# Utilities
atuin \
bat \
bat-extras \
bottom \
btop \
celluloid \
eza \
fastfetch \
fish \
fisher \
glow \
gum \
libayatana-appindicator \
libayatana-indicator \
libappindicator-gtk3 \
nano \
reflector \
ruby \
rust \
starship \
tealdeer \
ueberzug \
wlroots \
yazi \
zenity \
# Multimedia
ffmpeg \
gstreamer \
gstreamer-vaapi \
meld \
mpv-mpris \
python-mutagen \
wl-clipboard \
yt-dlp \
# Others
alsa-lib \
alsa-plugins \
giflib \
gnutls \
gst-libav \
gst-plugins-bad \
gst-plugins-base \
gst-plugins-base-libs \
gst-plugins-good \
gst-plugins-ugly \
gtk3 \
lib32-alsa-lib \
lib32-alsa-plugins \
lib32-giflib \
lib32-gnutls \
lib32-gst-plugins-base \
lib32-gst-plugins-base-libs \
lib32-gst-plugins-good \
lib32-gtk3 \
lib32-libpulse \
lib32-libva \
lib32-libxcomposite \
lib32-ocl-icd \
lib32-sqlite \
lib32-v4l-utils \
libpulse \
libva \
libxcomposite \
ocl-icd \
sqlite \
v4l-utils \
--noconfirm && \
rm -rf /var/cache/pacman/pkg/*
USER build
WORKDIR /home/build
RUN git clone https://aur.archlinux.org/paru-bin.git --single-branch && \
cd paru-bin && \
makepkg -si --noconfirm && \
cd .. && \
rm -drf paru-bin
RUN paru -S \
aur/arttime-git \
aur/blackbox-terminal \
aur/discord_arch_electron \
aur/downgrade \
aur/hatt \
aur/jdownloader2 \
aur/linux-discord-rich-presence \
aur/megabasterd-bin \
aur/morewaita-icon-theme \
aur/pingu \
aur/vesktop-electron \
--noconfirm
USER root
WORKDIR /
RUN pacman -S --clean --clean
# Configs
RUN sed -i 's/#BottomUp/BottomUp/g' /etc/paru.conf && \
sed -i 's@#en_US.UTF-8@en_US.UTF-8@g' /etc/locale.gen && \
sed -i 's/-march=x86-64 -mtune=generic/-march=native -mtune=native/g' /etc/makepkg.conf && \
sed -i 's@ (linux-discord-rich-presence)@@g' /usr/share/applications/linux-discord-rich-presence.desktop
# Cleanup
RUN userdel -r build && \
rm -drf /home/build && \
sed -i '/build ALL=(ALL) NOPASSWD: ALL/d' /etc/sudoers && \
sed -i '/root ALL=(ALL) NOPASSWD: ALL/d' /etc/sudoers && \
rm -rf /home/build/.cache/* && \
rm -rf \
/tmp/* \
/var/cache/pacman/pkg/*
COPY box-files /
# Build gaming-box
FROM box AS gaming-box
RUN sed -i 's/-march=native -mtune=native/-march=x86-64 -mtune=generic/g' /etc/makepkg.conf
RUN pacman -S --needed \
libbsd \
wmctrl \
wxwidgets-gtk3 \
xorg-xwayland \
xorg-xwininfo \
--noconfirm && \
pacman -S --needed \
gamemode \
gnu-free-fonts \
goverlay \
lutris \
lib32-gamemode \
lib32-mangohud \
mangohud \
mesa-demos \
steam \
vulkan-tools \
--noconfirm && \
pacman -S --needed \
sdl2 \
lib32-sdl2 \
vkd3d \
lib32-vkd3d \
vulkan-icd-loader \
lib32-vulkan-icd-loader \
winetricks \
--noconfirm
# Create build user
RUN useradd -m --shell=/bin/bash build && usermod -L build && \
echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# Install AUR packages
USER build
WORKDIR /home/build
RUN paru -S \
aur/adwsteamgtk \
# aur/gamescope-plus \
aur/ludusavi-bin \
aur/protonplus \
aur/sgdboop-bin \
aur/steamcmd \
aur/steamtinkerlaunch \
aur/vkbasalt \
aur/lib32-vkbasalt \
--noconfirm
USER root
WORKDIR /
RUN pacman -S --clean --clean
COPY gb-files /
# Clean up Steam desktop entry
RUN sed -i 's@ (Runtime)@@g' /usr/share/applications/steam.desktop && \
sed -i 's/-march=x86-64 -mtune=generic/-march=native -mtune=native/g' /etc/makepkg.conf
# Clean up any unnecessary files
RUN userdel -r build && \
rm -drf /home/build && \
sed -i '/build ALL=(ALL) NOPASSWD: ALL/d' /etc/sudoers && \
sed -i '/root ALL=(ALL) NOPASSWD: ALL/d' /etc/sudoers && \
rm -rf /home/build/.cache/* && \
rm -rf \
/tmp/* \
/var/cache/pacman/pkg/*