DEV Community

Discussion on: Developing from Containers

Collapse
 
aghost7 profile image
Jonathan Boudreau

It depends what operating system you're using. If on Linux, you can mount the X11 socket and that's pretty much all you need to do. Here's an example:

# allow user inside of container to connect to the X11 server
xhost +si:localuser:root
# create container running gedit
docker run -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix ubuntu:bionic bash -c 'apt-get update; apt-get install gedit -y ; gedit'

Depending on the program you may also want to expose additional devices to leverage hardware acceleration. For example I think the Oni editor uses webgl.