# t20-blender-donut-40 task image. # # Standalone (not FROM any suite base): the agent's whole world is Blender # 5.0.1 plus three captioned Blender Guru tutorial videos in Chromium, on the # XFCE desktop harbor's computer-1 drives with xdotool. No terminal, no # network at run time, no Python console / text editor / Scripting workspace # inside Blender (Sid's rule: the coding tools are disabled). # # Build context is THIS directory: # docker buildx build --platform linux/amd64 \ # -t refresh-blender-donut:t20 suite_tasks/t20-blender-donut-40/environment # (harbor does exactly that for local runs.) Blender is downloaded at build # time from an official mirror and pinned by the release SHA-256. The # tutorials (environment/tutorial/*.mp4, gitignored — regenerate with # tools/fetch-tutorial.sh) and the reference image are COPY'd in. FROM debian:bookworm-slim ARG BLENDER_VERSION=4.0.2 ARG BLENDER_SHA256=5583a5588736da8858c522ef17fff5d73be59c47a6fe91ad29c6f3263e22086a ARG BLENDER_MIRROR=https://ftp.nluug.nl/pub/graphics/blender/release ENV DEBIAN_FRONTEND=noninteractive \ HOME=/root \ LANG=C.UTF-8 # Desktop stack expected by harbor computer-1 (it execs Xvfb, startxfce4, # x11vnc, /usr/bin/chromium, xdotool, wmctrl, ImageMagick `import`, cwebp — # none of it is installed by the harness), plus: # * Mesa software GL (llvmpipe): Xvfb has no GPU; Blender needs OpenGL 4.3 # and llvmpipe reports 4.5. # * Blender's X11 runtime deps (the tarball bundles Python, libs, ffmpeg). # * thunar + xfdesktop4: Desktop icons (relaunch routes) and a file manager # the agent can use to find the reference image. # * python3 + pytest: the verifier runs in-container with no network. # * Debian chromium plays H.264 (the captioned tutorials). RUN apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates curl xz-utils procps \ chromium xvfb xfce4-session xfwm4 xfce4-panel xfce4-settings xfdesktop4 \ x11vnc xdotool wmctrl imagemagick webp dbus-x11 \ thunar xdg-utils \ fonts-dejavu-core fonts-liberation fonts-noto-color-emoji \ libgl1-mesa-dri libglx-mesa0 libegl1 libgl1 libglu1-mesa \ libx11-6 libxi6 libxxf86vm1 libxfixes3 libxrender1 libxext6 libxinerama1 \ libxrandr2 libxcursor1 libxkbcommon0 libxkbcommon-x11-0 libsm6 libice6 \ libfontconfig1 libfreetype6 libdbus-1-3 libpulse0 libasound2 libgomp1 \ libtbb12 libzstd1 libsndfile1 libopenal1 libjack0 libwayland-client0 \ python3 python3-pip \ && pip3 install --no-cache-dir --break-system-packages \ pytest==8.4.1 pytest-json-ctrf==0.3.5 \ && rm -rf /var/lib/apt/lists/* # Blender: official Linux x64 tarball, SHA-256 pinned (blender-5.0.1.sha256 # on the release server). ldd assertion fails the build if a runtime lib is # missing rather than at the agent's first launch. RUN set -eux; \ curl -fsSL -A "Mozilla/5.0" -o /tmp/blender.tar.xz \ "${BLENDER_MIRROR}/Blender$(echo "${BLENDER_VERSION}" | cut -d. -f1,2)/blender-${BLENDER_VERSION}-linux-x64.tar.xz"; \ echo "${BLENDER_SHA256} /tmp/blender.tar.xz" | sha256sum -c -; \ mkdir -p /opt/blender; \ tar -xJf /tmp/blender.tar.xz -C /opt/blender --strip-components=1; \ rm -f /tmp/blender.tar.xz; \ test -x /opt/blender/blender; \ missing="$(ldd /opt/blender/blender | grep 'not found' || true)"; \ if [ -n "$missing" ]; then echo "blender: unresolved libs:"; echo "$missing"; exit 1; fi # NO CODING TOOLS (Sid): remove the Python console backend + operators, strip # "Run Script" from the text editor UI, install the startup guard that deletes # the Scripting workspace and converts Console/Text areas away (see the # headers of nocode-patch.py and nocode_guard.py). The patch asserts each edit. COPY nocode-patch.py nocode_guard.py /tmp/nocode/ RUN python3 /tmp/nocode/nocode-patch.py /opt/blender/4.0/scripts \ && test ! -e /opt/blender/4.0/scripts/startup/bl_operators/console.py \ && test ! -e /opt/blender/4.0/scripts/modules/_console_python.py \ && test -f /opt/blender/4.0/scripts/startup/nocode_guard.py \ && ! grep -q "text.run_script" /opt/blender/4.0/scripts/startup/bl_ui/space_text.py \ && rm -rf /tmp/nocode # numpy ships with Blender; Pillow is not needed (the render comparison reads PNGs # through bpy.data.images, like refresh-platform's render_compare does). # Preferences are baked at CONTAINER START, not at build: Blender 4.0.2 aborts # under qemu-user on the Apple-silicon build host ("ArchError: Could not find # 'cpu MHz' in /proc/cpuinfo", 2026-09-09) although 5.0.1 ran fine there. The # launcher runs /opt/refresh/setprefs.py headless before the first GUI launch # (2 s on a real amd64 CPU); nocode_guard pins the same prefs at every load. COPY setprefs.py /opt/refresh/setprefs.py # The fourteen tutorials (captions burned in, no audio needed) + the player page # that is the browser start_url, and the assets the reference learner used: # the Poliigon marble maps (Part 5 counter), the whiskey-set and agave-plant # .blend models (Part 10 "importing a model" — File > Append offline). COPY tutorial/index.html /opt/tutorial/ COPY tutorial/part1.mp4 tutorial/part2.mp4 tutorial/part3.mp4 tutorial/part4.mp4 tutorial/part5.mp4 \ tutorial/part6.mp4 tutorial/part7.mp4 tutorial/part8.mp4 tutorial/part9.mp4 tutorial/part10.mp4 \ tutorial/part11.mp4 tutorial/part12.mp4 tutorial/part13.mp4 tutorial/part14.mp4 /opt/tutorial/ COPY assets/QuartziteDenali002/ /root/Downloads/QuartziteDenali002/ COPY assets/GlasswareWhiskeySet002/ /root/Downloads/GlasswareWhiskeySet002/ COPY assets/PlantAgave002/ /root/Downloads/PlantAgave002/ RUN for i in $(seq 1 14); do test -s /opt/tutorial/part$i.mp4 || { echo "missing part$i.mp4"; exit 1; }; done \ && test -s /root/Downloads/QuartziteDenali002/QuartziteDenali002_COL_8K_METALNESS.png \ && test -s /root/Downloads/GlasswareWhiskeySet002/GlasswareWhiskeySet002_Blender_Cycles.blend \ && test -s /root/Downloads/PlantAgave002/PlantAgave002_Blender_Cycles.blend \ && mkdir -p /root/donut /logs/verifier /root/Desktop /usr/share/applications # Browser hardening for both chromiums (harness + Tutorial launcher): Debian's # /usr/bin/chromium sources /etc/chromium.d/*. COPY chromium-safe-flags /etc/chromium.d/90-t19-safe RUN grep -q "chromium.d" /usr/bin/chromium && test -s /etc/chromium.d/90-t19-safe # Desktop launchers (relaunch routes without a shell) + the entrypoint/launcher. COPY blender.desktop tutorial.desktop /root/Desktop/ COPY blender-relaunch.sh /usr/local/bin/blender-relaunch COPY blender-launcher.sh /usr/local/bin/blender-launcher COPY start-blender-task.sh /usr/local/bin/start-blender-task COPY smoke-desktop.sh /usr/local/bin/smoke-desktop RUN chmod 755 /root/Desktop/*.desktop /usr/local/bin/blender-relaunch /usr/local/bin/blender-launcher \ /usr/local/bin/start-blender-task /usr/local/bin/smoke-desktop \ && cp /root/Desktop/blender.desktop /root/Desktop/tutorial.desktop /usr/share/applications/ \ && xdg-mime default thunar.desktop inode/directory || true # No terminal for the agent. Nothing above installs one, but XFCE ships # launcher stubs pointing at absent programs; remove them so no menu offers # one, and fail the build if any terminal emulator is present after all. RUN rm -f /usr/share/applications/xfce4-terminal-emulator.desktop \ /usr/share/applications/debian-xterm.desktop /usr/share/applications/debian-uxterm.desktop \ && rm -f /usr/share/xfce4/helpers/*term*.desktop /usr/share/xfce4/helpers/debian-x-terminal-emulator.desktop \ && for b in xterm uxterm xfce4-terminal x-terminal-emulator gnome-terminal konsole; do \ command -v "$b" >/dev/null 2>&1 && { echo "terminal $b present" >&2; exit 1; }; done; \ ! ls /usr/share/applications | grep -qi term && echo "no terminal emulator in image" ENV DISPLAY=:1 \ LIBGL_ALWAYS_SOFTWARE=1 \ GALLIUM_DRIVER=llvmpipe \ XDG_CONFIG_HOME=/root/.config \ XDG_DATA_HOME=/root/.local/share \ XDG_CACHE_HOME=/root/.cache WORKDIR /root CMD ["/usr/local/bin/start-blender-task"]