Repository navigation
Expand file tree
/
Copy pathContainerfile
More file actions
339 lines (284 loc) · 10.6 KB
/
Copy pathContainerfile
File metadata and controls
339 lines (284 loc) · 10.6 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
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
336
337
338
339
ARG FEDORA_VERSION=44
ARG BASE_IMAGE=quay.io/fedora/fedora-bootc:${FEDORA_VERSION}
ARG FEDORA_SIGNING_KEY_ID=6d9f90a6
ARG SPACEOS_VERSION=0.0.0-devel
ARG SPACEOS_BUILD_ID=local
# ============================================================
# Build DisplayLink EVDI kernel module
# ============================================================
FROM ${BASE_IMAGE} AS displaylink-builder
ARG FEDORA_VERSION
ARG FEDORA_SIGNING_KEY_ID
ADD https://negativo17.org/repos/fedora-multimedia.repo /etc/yum.repos.d/negativo17-fedora-multimedia.repo
COPY --chmod=0755 scripts/build-displaylink.sh /usr/local/bin/build-displaylink
RUN build-displaylink "${FEDORA_VERSION}" "${FEDORA_SIGNING_KEY_ID}"
# ============================================================
# SpaceOS
# ============================================================
FROM ${BASE_IMAGE}
COPY --from=displaylink-builder /out /tmp/displaylink
RUN set -eux \
&& dnf5 -y install \
/tmp/displaylink/userspace/*.rpm \
/tmp/displaylink/kmod/*.rpm \
&& KERNEL_VERSION="$(find /usr/lib/modules \
-mindepth 1 -maxdepth 1 -type d \
-printf '%f\n' | head -n1)" \
&& depmod -a "${KERNEL_VERSION}" \
&& rm -rf /tmp/displaylink
# ============================================================
# Package repositories
# ============================================================
ARG CHATGPT_RPM_URL=https://persistent.oaistatic.com/codex-app-prod/linux/rpm/latest/chatgpt.x86_64.rpm
ARG SOPS_RPM_URL=https://github.com/getsops/sops/releases/download/v3.13.3/sops-3.13.3-1.x86_64.rpm
ADD https://github.com/usebruno/bruno/releases/download/v4.1.0/bruno_4.1.0_x86_64_linux.rpm /tmp/bruno.rpm
RUN printf '%s %s\n' \
b80dd8b308a675c23d7263b34c52d6b3886a4e05257c1f8d4f3c0c5cd23a31f4 \
/tmp/bruno.rpm \
| sha256sum --check --strict
ADD --chmod=0644 \
https://repo.teamsforlinux.de/teams-for-linux.asc /etc/pki/rpm-gpg/teams-for-linux.asc
RUN set -eux \
&& rpm --import /etc/pki/rpm-gpg/teams-for-linux.asc \
&& dnf5 install -y \
'dnf5-command(config-manager)' \
&& dnf5 config-manager addrepo \
--from-repofile https://download.docker.com/linux/fedora/docker-ce.repo \
&& dnf5 config-manager addrepo \
--from-repofile https://repo.teamsforlinux.de/rpm/teams-for-linux.repo
RUN sudo dnf install -y \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
# ============================================================
# Fedora and RPM packages
# ============================================================
RUN set -eux \
&& : "Firmware" \
&& dnf5 install -y --allow-downgrade --allowerasing \
linux-firmware-whence \
iwlwifi-mvm-firmware \
&& : "System and desktop" \
&& dnf5 install -y \
glibc-langpack-pl \
linux-firmware \
NetworkManager-wifi \
fuse-libs \
greetd \
greetd-selinux \
tuigreet \
sway \
swayidle \
mako \
waybar \
plymouth \
plymouth-plugin-two-step \
plymouth-theme-spinner \
librsvg2-tools \
adw-gtk3-theme \
xdg-desktop-portal-gtk \
wiremix \
brightnessctl \
rofi \
alacritty \
grim \
slurp \
swappy \
wf-recorder \
bluez \
&& : "Development and command-line tools" \
&& dnf5 install -y \
jq \
fish \
nvim \
mc \
git \
tmux \
golang \
zig \
raylib-devel \
uv \
rclone \
rsync \
nc \
translate-shell \
fzf \
fd-find \
bat \
htop \
newsboat \
"${SOPS_RPM_URL}" \
age \
&& : "Container tools" \
&& dnf5 install -y \
podman \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
&& : "Desktop applications" \
&& dnf5 install -y \
java-25-openjdk \
firefox \
chromium \
"${CHATGPT_RPM_URL}" \
/tmp/bruno.rpm \
teams-for-linux \
thunderbird \
qbittorrent \
vlc \
vlc-plugins-freeworld \
libavcodec-freeworld \
gimp \
filezilla \
imv \
gnome-disk-utility \
foliate \
libreoffice-calc \
libreoffice-writer \
&& rm -f /tmp/bruno.rpm \
&& dnf5 clean all
# ============================================================
# Standalone applications and tools
# ============================================================
# Signal - A private messaging application
ADD --chmod=0755 \
https://updates.signal.org/desktop/signal-desktop.AppImage /usr/bin/signal-desktop
# ZK - A command-line tool for managing Zettelkasten notes
ADD https://github.com/zk-org/zk/releases/download/v0.15.6/zk-v0.15.6-linux-amd64.tar.gz /tmp/zk.tar.gz
RUN set -eux \
&& printf '%s %s\n' \
50b2f0a8c533d607e5a8a1f478fe78d5585317178bd86456659c049965a8945d \
/tmp/zk.tar.gz \
| sha256sum --check --strict \
&& tar -xzf /tmp/zk.tar.gz -C /usr/bin zk \
&& chmod 0755 /usr/bin/zk \
&& zk --version \
&& rm -f /tmp/zk.tar.gz
# LazyGit - A simple terminal UI for git commands
ADD https://github.com/jesseduffield/lazygit/releases/download/v0.65.1/lazygit_0.65.1_linux_x86_64.tar.gz /tmp/lazygit.tar.gz
RUN set -eux \
&& printf '%s %s\n' \
02beacbcda0fa342e50ae3480ba8147307353af3fb28e1d5f790e02329c201a6 \
/tmp/lazygit.tar.gz \
| sha256sum --check --strict \
&& tar -xzf /tmp/lazygit.tar.gz -C /usr/bin lazygit \
&& chmod 0755 /usr/bin/lazygit \
&& lazygit --version \
&& rm -f /tmp/lazygit.tar.gz
# wlctl - TUI for managing wifi/ethernet/vpn
ADD https://github.com/aashish-thapa/wlctl/releases/download/v0.1.10/wlctl-x86_64-unknown-linux-musl /usr/bin/wlctl
RUN set -eux \
&& printf '%s %s\n' \
d980e56367f40a507463c645e690e052ff7a1a72bd7b945efc1a8fbd7c7c9927 \
/usr/bin/wlctl \
| sha256sum --check --strict \
&& chmod 0755 /usr/bin/wlctl \
&& wlctl --version
# bluetui - TUI for managing bluetooth devices
ADD https://github.com/pythops/bluetui/releases/download/v0.8.1/bluetui-x86_64-linux-musl /usr/bin/bluetui
RUN set -eux \
&& printf '%s %s\n' \
c6d133930af3ef85d5fb6492c98982958619284d1f583c2c8ecf46992460d60e \
/usr/bin/bluetui \
| sha256sum --check --strict \
&& chmod 0755 /usr/bin/bluetui \
&& bluetui --version
# ZAP - A security tool for finding vulnerabilities in web applications
ADD https://github.com/zaproxy/zaproxy/releases/download/v2.17.0/ZAP_2.17.0_Linux.tar.gz /tmp/zap.tar.gz
RUN set -eux \
&& printf '%s %s\n' \
efe799aaa3627db683b43f00c9c210aea0b75c00cc8f0a0f0434d12bb3ddde5a \
/tmp/zap.tar.gz \
| sha256sum --check --strict \
&& mkdir -p /usr/lib/zaproxy \
&& tar -xzf /tmp/zap.tar.gz \
--strip-components=1 \
-C /usr/lib/zaproxy \
&& rm -f /tmp/zap.tar.gz
# ============================================================
# Global npm tools
# ============================================================
RUN set -eux \
&& mkdir -p /tmp/npm-cache \
&& npm install -g \
--prefix /usr \
--cache /tmp/npm-cache \
@openai/codex \
@github/copilot \
opencommit \
&& rm -rf /tmp/npm-cache
# ============================================================
# System configuration
# ============================================================
COPY kargs.d/ /usr/lib/bootc/kargs.d/
COPY . /etc/spaceos/
RUN cp -asf --remove-destination /etc/spaceos/rootfs/. /
RUN glib-compile-schemas /usr/share/glib-2.0/schemas
# ============================================================
# Branding and fonts
# ============================================================
COPY assets/spaceos-logo-dark.svg /usr/share/spaceos/spaceos-logo.svg
ADD --chmod=0644 \
https://raw.githubusercontent.com/googlefonts/noto-emoji/v2.051/fonts/NotoColorEmoji.ttf /usr/share/fonts/noto-emoji/NotoColorEmoji.ttf
RUN set -eux \
&& rsvg-convert \
--width 465 \
--height 120 \
--output /usr/share/plymouth/themes/spinner/watermark.png \
/usr/share/spaceos/spaceos-logo.svg \
&& sed -i \
-e 's/^WatermarkHorizontalAlignment=.*/WatermarkHorizontalAlignment=.5/' \
-e 's/^WatermarkVerticalAlignment=.*/WatermarkVerticalAlignment=.36/' \
-e 's/^DialogHorizontalAlignment=.*/DialogHorizontalAlignment=.5/' \
-e 's/^DialogVerticalAlignment=.*/DialogVerticalAlignment=.53/' \
-e 's/^HorizontalAlignment=.*/HorizontalAlignment=.5/' \
-e 's/^VerticalAlignment=.*/VerticalAlignment=.68/' \
/usr/share/plymouth/themes/spinner/spinner.plymouth \
&& grep -q '^WatermarkVerticalAlignment=.36$' \
/usr/share/plymouth/themes/spinner/spinner.plymouth \
&& grep -q '^DialogVerticalAlignment=.53$' \
/usr/share/plymouth/themes/spinner/spinner.plymouth \
&& grep -q '^VerticalAlignment=.68$' \
/usr/share/plymouth/themes/spinner/spinner.plymouth \
&& plymouth-set-default-theme spinner
RUN fc-cache -f -v
# ============================================================
# Initramfs
# ============================================================
RUN set -eux \
&& KERNEL_VERSION="$(find /usr/lib/modules \
-mindepth 1 -maxdepth 1 -type d \
-printf '%f\n' | head -n1)" \
&& env DRACUT_NO_XATTR=1 \
dracut -vf "/usr/lib/modules/${KERNEL_VERSION}/initramfs.img" "${KERNEL_VERSION}"
# ============================================================
# OS metadata
# ============================================================
ARG SPACEOS_VERSION
ARG SPACEOS_BUILD_ID
RUN printf '%s\n' \
'NAME="SpaceOS"' \
"VERSION=\"${SPACEOS_VERSION}\"" \
'ID=spaceos' \
'ID_LIKE=fedora' \
"VERSION_ID=\"${SPACEOS_VERSION}\"" \
"BUILD_ID=\"${SPACEOS_BUILD_ID}\"" \
"PRETTY_NAME=\"SpaceOS ${SPACEOS_VERSION}\"" \
'HOME_URL="https://github.com/SpaceShaman/spaceos"' \
'DOCUMENTATION_URL="https://github.com/SpaceShaman/spaceos"' \
'BUG_REPORT_URL="https://github.com/SpaceShaman/spaceos/issues"' \
>/usr/lib/os-release \
&& ln -sfn ../usr/lib/os-release /etc/os-release \
&& rm -f /etc/system-release \
&& printf 'SpaceOS\n' >/etc/system-release
# ============================================================
# Services and validation
# ============================================================
RUN systemctl enable \
displaylink.service \
docker.service \
containerd.service \
greetd.service \
bluetooth.service \
&& systemctl set-default graphical.target
RUN bootc container lint