docker run --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY fsl fsleyes
Where the difference appears to binding the /tmp/X11-unix path to the container.
If you are using windows, the solution may be more complicated.
Running GUI applications through docker containers has been a pain for me in the past, so I empathize. (today I really only use browser-based GUIs for applications that run through the browser and use applications like FSL through the command line).
Hello James,
Thank you. Your code worked. I run 1 then 2 (docker run --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY docker-image-name | fsl & fsleyes &).