How to run electron app inside docker image? How to run electron app inside docker image? docker docker

How to run electron app inside docker image?


What you're looking for is called x11 forwarding.

Unfortunately, it'll be a little trickier to surface the underlying UI from with the running docker container than if you were using a linux distribution - docker containers are all pretty much linux based. You can't really mount the related unix socket

Normally you just add the following lines to your image

RUN xhost local:root

and run with the socket mounted

docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY

On the brightside,

There appears to be a solution which is easy as installing

  • VcXsrv
  • Adding the $DISPLAY env variable with the server ip

Follow the instructions here

https://dev.to/darksmile92/run-gui-app-in-linux-docker-container-on-windows-host-4kde