Files
Classroom_Desktop/tools/lab/Dockerfile.plasma
T
ekklesiaandClaude Opus 5 87b55761c6 feat: give the classroom a desktop instead of a shell
The whole appliance UI is now configuration for a desktop Debian already
ships: a Plasma 6.3 session with a colour scheme, a look and feel package
that builds the bar, window rules, and KDE's own Kiosk restrictions.

Two things were measured rather than assumed, and both changed a decision.

Plasma restarts a crashed panel three times a minute and then gives up,
which is the failure a classroom has already had. Four lines of systemd
drop-in make it unconditional; the panel then survived eight SIGKILLs a
second apart, back each time in 2.4s.

Plasma draws a minimised task and a background task identically, so the
five states the room needs cannot all be shown. Rather than write a task
manager, the classroom removes minimise: clicking a launcher always means
show me this.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-10 08:35:12 -05:00

73 lines
3.2 KiB
Docker

# Classroom v2 test lab: a full Debian 13 Plasma 6 desktop, running under
# systemd, inside a container. It exists because the development host is
# itself a VM with no /dev/kvm, so a real virtual machine cannot be created
# here. See docs/classroom-v2-experiment.md.
#
# docker build -f tools/lab/Dockerfile.plasma -t classroom-v2-lab:plasma .
# tools/lab/lab up
#
FROM debian:trixie
ENV DEBIAN_FRONTEND=noninteractive
ENV container=docker
# systemd, so the session is supervised the way it would be on a real machine
RUN apt-get update && apt-get install -y systemd systemd-sysv dbus dbus-user-session \
&& rm -rf /var/lib/apt/lists/*
# The desktop under test.
RUN apt-get update && apt-get install -y \
plasma-desktop plasma-workspace kwin-wayland \
plasma-nm plasma-pa \
&& rm -rf /var/lib/apt/lists/*
# Software rendering, X11 apps, fonts, and the tools the lab drives it with.
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-dri libglx-mesa0 mesa-utils-bin libegl-mesa0 \
xwayland \
fonts-noto-core fonts-dejavu-core fonts-liberation \
kde-cli-tools qdbus-qt6 \
sway swaybg grim wtype foot \
python3 python3-gi gir1.2-gtk-3.0 \
curl ca-certificates gnupg procps psmisc less vim-tiny socat jq \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 -s /bin/bash classroom \
&& usermod -aG video,render,audio classroom \
&& passwd -d classroom \
&& mkdir -p /run/user/1000 && chown classroom:classroom /run/user/1000 \
&& systemctl enable systemd-logind
# Linger so the classroom user's systemd instance starts with the container,
# which is exactly how the appliance would run.
RUN mkdir -p /var/lib/systemd/linger && touch /var/lib/systemd/linger/classroom
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]
# Screenshots. KWin's org.kde.KWin.ScreenShot2 only answers callers it
# recognises by path, and Spectacle is one of them, so this is the
# sanctioned way to capture a KWin session that has no outer compositor.
RUN apt-get update && apt-get install -y --no-install-recommends kde-spectacle \
&& rm -rf /var/lib/apt/lists/*
# The classroom's browser, from Google's own repository, the same way a
# classroom machine gets it. Testing the browser question on a different
# browser would not answer it.
RUN apt-get update && apt-get install -y --no-install-recommends gnupg \
&& install -d -m 0755 /etc/apt/keyrings \
&& curl -fsS https://dl.google.com/linux/linux_signing_key.pub \
| gpg --dearmor --batch --yes --output /etc/apt/keyrings/google-chrome.gpg \
&& echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] https://dl.google.com/linux/chrome/deb/ stable main' \
> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install -y --no-install-recommends google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
# VLC, CUPS and PipeWire: the rest of the classroom's runtime, so the
# desktop is judged with the room's real applications in it.
RUN apt-get update && apt-get install -y --no-install-recommends \
vlc vlc-plugin-base cups cups-client cups-filters \
pipewire pipewire-pulse wireplumber pulseaudio-utils \
libnotify-bin \
&& rm -rf /var/lib/apt/lists/*