sofa
sofa copied to clipboard
Execute runSofa in Docker with GUI on any host platform
Based on the images here: https://hub.docker.com/r/sofaframework/sofa_nightly_ubuntu/tags
I can execute runSofa successfully with a Ubuntu host. I want it to also work with a Windows or a MacOS host.
I also want to document some how-to examples.
Execute the latest runSofa on a Ubuntu host
docker pull sofaframework/sofa_nightly_ubuntu:v21.06-standard
xhost +local:root
docker run --rm --user "sofa:sofa" --network="host" --env="DISPLAY" -v "$HOME/.Xauthority:/home/sofa/.Xauthority:ro" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -t sofaframework/sofa_nightly_ubuntu:master-standard runSofa
xhost -local:root
Execute the latest runSofa on a Windows host (working but pretty slow)
Taken from https://dev.to/darksmile92/run-gui-app-in-linux-docker-container-on-windows-host-4kde
and https://medium.com/@potatowagon/how-to-use-gui-apps-in-linux-docker-container-from-windows-host-485d3e1c64a3
First of all, install VcXsrv Windows X Server. Here we use Chocolatey but it's not mandatory.
choco install vcxsrv
Once installation is done, run XLaunch from start menu and make sure to activate the option "Disable access control".
Then, get your IP with ipconfig
.
Finally, in a PowerShell terminal
docker run --rm --user "sofa:sofa" -e DISPLAY=your_IP_goes_here:0.0 -t sofaframework/sofa_nightly_ubuntu:master-standard runSofa