Docker Community Forums

Share and learn in the Docker community.

Docker swarm .... --env DISPLAY=:0 ... issue

Hello all I am able to issue the following command directly in docker to open a Chrome browser in Kiosk Mode without any issue:

docker run --name=chrome -v /tmp/.X11-unix:/tmp/.X11-unix --memory 512mb -e DISPLAY=:0 my/image

When I try to create a service with docker swarm with:

docker service create --name=chrome --net=host --mount type=volume,destination=/tmp/.X11-unix:/tmp/.X11-unix --env DISPLAY=:0 my/image

I get the following error: (chromium-browser:1): Gtk-WARNING **: 23:11:37.396: cannot open display: :0

I have a feeling its something related to the host network is not available to docker swarm overlay network… Is there something I can do to pass the :0 host display in docker swarm services so I can force the display on all my workers to display my chrome kiosk?

Thanks so much for any help or insight.