1FROM docker.io/rockylinux/rockylinux@sha256:7b2eba7b6bf1c5c93f343c5f03a582e4e32ffd7c19187010c6aa2a848bce295a AS installer
2
3# Fusion Studio 21.1 for Linux; render nodes must match the Fusion Studio version that submits to them.
4ARG DOWNLOAD=c2ad9534bf5746cd8a9db063f1cad9b1
5ARG SHA256=a19bb7c95eb0c00abf96f7d236a195da6729f07e9f3b81bbe7fc15869eba816f
6ARG RUN=Blackmagic_Fusion_Render_Node_Linux_21.1_installer.run
7RUN dnf -y install epel-release && dnf -y install python3 squashfs-tools && dnf clean all
8# Studio downloads need no registration details beyond a country.
9RUN python3 -I -c 'import hashlib, json, sys, urllib.request, zipfile; \
10 agent = {"User-Agent": "Mozilla/5.0"}; \
11 request = urllib.request.Request("https://www.blackmagicdesign.com/api/register/us/download/" + sys.argv[1], json.dumps({"country": "us", "downloadOnly": True}).encode(), {**agent, "Content-Type": "application/json"}); \
12 url = urllib.request.urlopen(request).read().decode(); \
13 digest = hashlib.sha256(); \
14 out = open("/tmp/fusion.zip", "wb"); \
15 response = urllib.request.urlopen(urllib.request.Request(url, headers=agent)); \
16 [(digest.update(chunk), out.write(chunk)) for chunk in iter(lambda: response.read(1 << 20), b"")]; \
17 out.close(); \
18 assert digest.hexdigest() == sys.argv[2], digest.hexdigest(); \
19 zipfile.ZipFile("/tmp/fusion.zip").extract(sys.argv[3], "/tmp")' "$DOWNLOAD" "$SHA256" "$RUN" \
20 && rm /tmp/fusion.zip
21# The installer is an AppImage; its squashfs payload starts where the ELF runtime's section headers end.
22RUN offset=$(python3 -I -c 'import struct, sys; header = open(sys.argv[1], "rb").read(64); \
23 print(struct.unpack_from("<Q", header, 0x28)[0] + struct.unpack_from("<H", header, 0x3A)[0] * struct.unpack_from("<H", header, 0x3C)[0])' "/tmp/$RUN") \
24 && mkdir -p /opt/BlackmagicDesign && unsquashfs -o "$offset" -d /opt/BlackmagicDesign/FusionRenderNode21 "/tmp/$RUN" \
25 && rm "/tmp/$RUN" \
26 && cd /opt/BlackmagicDesign/FusionRenderNode21 \
27 && rm -f AppRun FusionInstaller FusionInstaller.desktop filelist.txt \
28 && chmod -R a+rX,go-w .
29
30FROM docker.io/rockylinux/rockylinux@sha256:7b2eba7b6bf1c5c93f343c5f03a582e4e32ffd7c19187010c6aa2a848bce295a
31# The installer's own Rocky/RHEL dependency list, plus Xvfb for its Qt GUI thread and an OpenCL loader.
32RUN dnf -y install epel-release && dnf -y install --setopt=install_weak_deps=False \
33 alsa-lib apr apr-util bzip2-libs dbus-libs expat fontconfig freetype glib2 libgomp libICE libSM libuuid \
34 libX11 libXau libxcb libXcursor libXext libXfixes libXi libXinerama libxkbcommon libxkbcommon-x11 \
35 libXrandr libXrender libXtst libXxf86vm libglvnd-egl libglvnd-glx libglvnd-opengl mesa-libGLU \
36 mesa-dri-drivers systemd-libs xcb-util xcb-util-image xcb-util-keysyms xcb-util-renderutil xcb-util-wm \
37 ocl-icd xorg-x11-server-Xvfb dejavu-sans-fonts liberation-sans-fonts \
38 && dnf clean all
39COPY --from=installer /opt/BlackmagicDesign /opt/BlackmagicDesign
40WORKDIR /opt/BlackmagicDesign/FusionRenderNode21