# rdp-kit-server's Linux test bed (test/linux.sh): systemd as PID 1, GNOME Shell for the
# session manager's headless sessions, Xvfb for the kit's client, and a Python to run
# the wheel. The shape is rdp-release-kit's test/linux-host/Dockerfile. Everything in
# it is synthetic: the user tester, its password set by the test, sudo without one
# (as on a CI runner).
ARG BASE=docker.io/library/debian:testing
FROM ${BASE}
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        systemd systemd-sysv libpam-systemd dbus dbus-user-session \
        gnome-shell gnome-session xwayland gsettings-desktop-schemas adwaita-icon-theme fonts-dejavu-core \
        pipewire pipewire-bin wireplumber foot \
        xvfb xauth \
        libpulse0 libxcursor1 libxi6 libxrandr2 libxss1 libxkbcommon0 \
        libxdamage1 libxinerama1 libxtst6 libxfixes3 libxext6 \
        procps psmisc iproute2 xz-utils ca-certificates sudo passwd \
        python3 python3-venv \
    && rm -rf /var/lib/apt/lists/*
# what a container has no use for, and what would fail in one
RUN systemctl mask systemd-udev-trigger.service systemd-networkd.service \
        systemd-resolved.service systemd-firstboot.service > /dev/null 2>&1; \
    useradd -m -u 1000 -s /bin/bash tester && \
    echo 'tester ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/tester && chmod 440 /etc/sudoers.d/tester
CMD ["/usr/lib/systemd/systemd"]
