Examples of X11 forwarding to Docker for Linux and macOS. In both situations:
xhost
is used to set the host and/or user names allowed to make connections to the X server- The
DISPLAY
Docker environment variable must be set - The directory
/tmp/.X11-unix/
directory must be volume mounted into the container at/tmp/.X11-unix/