sidrefresh's picture
Add files using upload-large-folder tool
2e7de11 verified
Raw History Blame Contribute Delete
7.32 kB
# t24 Pong audiovisual recreation, GUI-only Friction + Shotcut.
# Build context: this environment directory. See ../README.md.
FROM --platform=linux/amd64 debian:bookworm AS guard_builder
RUN apt-get update && apt-get install -y --no-install-recommends g++ qtbase5-dev qtdeclarative5-dev pkg-config patchelf && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends xz-utils && rm -rf /var/lib/apt/lists/*
COPY friction.tar.xz /tmp/friction.tar.xz
RUN mkdir /friction && tar -xJf /tmp/friction.tar.xz -C /friction --strip-components=1
COPY friction-gui-only.cpp /src/friction-gui-only.cpp
RUN mkdir /output && g++ -shared -fPIC -std=c++17 -O2 -DQT_NO_VERSION_TAGGING $(pkg-config --cflags Qt5Widgets Qt5Qml) /src/friction-gui-only.cpp -L/friction/lib -Wl,-rpath,/opt/friction/lib -l:libQt5WidgetsFriction.so.5 -l:libQt5QmlFriction.so.5 -l:libQt5GuiFriction.so.5 -l:libQt5CoreFriction.so.5 -ldl -o /output/libfriction-gui-only.so
RUN cp /friction/bin/friction /output/friction && patchelf --add-needed libfriction-gui-only.so /output/friction && patchelf --print-needed /output/friction | head -5
FROM --platform=linux/amd64 vedit-task:base AS prepared
# --- Friction (verbatim from t16: bundled Qt5/Skia/ffmpeg; Pulse null sink
# stops the modal audio error; portable.txt removed; ldd assertion) ---------
COPY friction.tar.xz /tmp/
COPY debs/ /tmp/debs/
RUN dpkg -i /tmp/debs/*.deb \
&& mkdir -p /opt/friction \
&& tar -xJf /tmp/friction.tar.xz -C /opt/friction --strip-components=1 \
&& rm -rf /tmp/friction.tar.xz /tmp/debs \
&& test -x /opt/friction/bin/friction \
&& rm -f /opt/friction/bin/portable.txt \
&& missing="$(ldd /opt/friction/bin/friction | grep 'not found' || true)" \
&& { [ -z "$missing" ] || { echo "friction: unresolved libs:"; echo "$missing"; exit 1; }; }
COPY friction-launcher.sh /usr/local/bin/friction
RUN chmod 755 /usr/local/bin/friction
# Evaluation dependencies are baked into the image, never installed by tests.
RUN apt-get update && apt-get install -y --no-install-recommends python3-numpy python3-scipy python3-pil tesseract-ocr \
&& rm -rf /var/lib/apt/lists/*
# Only the exact supplied reference and four audio assets are agent-visible.
RUN rm -f /root/media/*.mp4
COPY media/ /root/media/
RUN test -s /root/media/reference.mp4 && test -s /root/media/contact.mp3 \
&& test -s /root/media/score.mp3 && test -s /root/media/wall.mp3 \
&& test -s "/root/media/game over.mp3" && mkdir -p /root/edit /root/Desktop
# --- Shotcut stays available (base) for anyone who wants to scrub the
# reference in an NLE; skip its first-run wizard, software GL, square 800p30
# is not a preset so leave the video mode automatic. --------------------------
RUN mkdir -p /root/.config/Meltytech \
&& printf '[General]\nfirstRun=false\ncheckUpgradeAutomatic=false\naskUpgradeAutomatic=false\ndrawMethod=2\nplayerGPU=false\n' \
> /root/.config/Meltytech/Shotcut.conf
# --- Friction autostarts (APP=friction); Desktop + menu launchers. --------
COPY friction-autostart.desktop /opt/autostart/friction-autostart.desktop
COPY friction.desktop /root/Desktop/friction.desktop
RUN chmod 755 /root/Desktop/friction.desktop \
&& mkdir -p /usr/share/applications \
&& cp /root/Desktop/friction.desktop /usr/share/applications/friction.desktop \
&& test -x /usr/local/bin/shotcut \
&& test -x /usr/bin/xfdesktop \
&& test -f /opt/autostart/shotcut-autostart.desktop
# --- GUI-ONLY (Sid, 2026-09-04): every terminal route becomes a logging stub
# (attempt -> /logs/artifacts/terminal-attempts.log -> reward 0), terminal /
# python / Kdenlive menu entries and the Ctrl+Alt+T shortcut go, XFCE kiosk
# mode blocks new panel launchers. python3 stays for the verifier. --------
COPY no-terminal.sh /usr/local/bin/no-terminal
COPY kiosk/kioskrc /etc/xdg/xfce4/kiosk/kioskrc
COPY shotcut-menu.desktop /usr/share/applications/shotcut.desktop
RUN chmod 755 /usr/local/bin/no-terminal \
&& for t in xterm uxterm lxterm koi8rxterm x-terminal-emulator xfce4-terminal xfce4-appfinder xfrun4; do \
rm -f "/usr/bin/$t" "/etc/alternatives/$t"; ln -s /usr/local/bin/no-terminal "/usr/bin/$t"; done \
&& rm -f /usr/share/applications/debian-xterm.desktop /usr/share/applications/debian-uxterm.desktop \
/usr/share/applications/xfce4-terminal-emulator.desktop /usr/share/applications/python3*.desktop \
/usr/share/applications/display-im6*.desktop /usr/share/applications/org.kde.kdenlive.desktop \
/usr/share/applications/xfce4-file-manager.desktop /usr/share/applications/xfce4-mail-reader.desktop \
/usr/share/applications/xfce4-web-browser.desktop /usr/share/applications/xfce4-settings-editor.desktop \
/usr/share/xfce4/helpers/*.desktop \
/root/Desktop/terminal.desktop /root/Desktop/kdenlive.desktop \
&& sed -i '/exo-open --launch TerminalEmulator/d' /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml \
&& sed -i 's/^TerminalEmulator=.*/TerminalEmulator=/; s/^FileManager=.*/FileManager=/' /etc/xdg/xfce4/helpers.rc \
&& test -x /usr/local/bin/shotcut && test -x /usr/local/bin/friction \
&& [ "$(readlink -f /usr/bin/xterm)" = /usr/local/bin/no-terminal ] \
&& ! ls /usr/share/applications | grep -qiE 'xterm|terminal|python|display-im6'
# Remove inherited applications and development executables, then flatten the
# final filesystem so removed apps are not retained in inherited image layers.
RUN apt-get purge -y chromium chromium-common chromium-sandbox kdenlive kdenlive-data xterm \
&& rm -rf /opt/natron /usr/local/bin/Natron /usr/local/bin/make-media /usr/lib/gcc \
&& rm -f /usr/bin/gcc* /usr/bin/g++* /usr/bin/x86_64-linux-gnu-gcc* /usr/bin/x86_64-linux-gnu-g++* /usr/bin/cc /usr/bin/c++ /usr/bin/c89-gcc /usr/bin/c99-gcc \
&& rm -f /usr/bin/exo-desktop-item-edit /usr/bin/exo-open /usr/bin/xfce4-keyboard-settings \
/usr/bin/xfce4-mime-settings /usr/bin/xfce4-settings-manager /usr/bin/xfce4-settings-editor \
&& rm -rf /var/lib/apt/lists/*
COPY harden-desktop.py /tmp/harden-desktop.py
RUN python3 /tmp/harden-desktop.py && rm /tmp/harden-desktop.py \
&& for t in xterm uxterm lxterm koi8rxterm x-terminal-emulator xfce4-terminal xfce4-appfinder xfrun4; do \
rm -f "/usr/bin/$t"; ln -s /usr/local/bin/no-terminal "/usr/bin/$t"; done \
&& test ! -e /usr/bin/chromium && test ! -e /usr/bin/kdenlive && test ! -e /opt/natron \
&& test -x /usr/bin/xfce4-session && test -x /usr/bin/startxfce4 && test -x /usr/bin/xrdb \
&& python3 -c "import scipy, numpy, PIL, pytest"
# Enforce the no-code restriction inside Friction as well as at desktop/tool
# entry points. The patched executable requires the guard even when opened
# directly. Compiler, headers and guard sources stay in the builder stage.
COPY --from=guard_builder /output/libfriction-gui-only.so /opt/friction/lib/libfriction-gui-only.so
COPY --from=guard_builder /output/friction /opt/friction/bin/friction
RUN ldd /opt/friction/bin/friction | tee /tmp/friction-guard-ldd \
&& ! grep -q 'not found' /tmp/friction-guard-ldd \
&& rm /tmp/friction-guard-ldd
FROM scratch
COPY --from=prepared / /
ENV DEBIAN_FRONTEND=noninteractive APP=friction SDL_AUDIODRIVER=dummy \
QSG_RHI_BACKEND=opengl LIBGL_ALWAYS_SOFTWARE=1
WORKDIR /root
CMD ["/usr/local/bin/start-editor"]