DEV Community

Discussion on: Do you use Docker?

Collapse
 
aghost7 profile image
Jonathan Boudreau

You can easily do this on Linux by mounting the x11 socket. For other platforms it isn't so simple.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Please elaborate / suggest an article...

Like Xorg on different ports?

Thread Thread
 
aghost7 profile image
Jonathan Boudreau

You can use the same Xorg instance:

docker run --rm -ti -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ubuntu:focal bash
apt update
apt install -y peek
peek
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited
root@1c26d4121e74:/# peek
No protocol specified

(peek:3525): Gtk-WARNING **: 10:24:14.930: cannot open display: :0
root@1c26d4121e74:/#
Enter fullscreen mode Exit fullscreen mode

I am on GNOME40 on Xorg.

Thread Thread
 
aghost7 profile image
Jonathan Boudreau

Maybe its related to me being on rootless docker? Might be that you need to create a user with the same uid as the host for your case.