Last active
October 2, 2025 13:39
-
-
Save montybytes/b619ede0dc032073af7d527e53423a23 to your computer and use it in GitHub Desktop.
A dockerfile that sets up a slim environment capable of running electron apps for development in an X11 desktop session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # !bin/bash | |
| # to test apps that require gpu acceleration, pass through the gpu devices using: | |
| # (please note this should be used with the docker "--security-opt" flag to control | |
| # sys calls and prevent privilege escalation attacks) | |
| # --device /dev/dri --device /dev/kfd | |
| # to test apps that require sound output, pass through sound devices using: | |
| # --device /dev/snd | |
| # to test apps that require video streams like web-cams use: | |
| # --device /dev/video{device_number} | |
| # other things I may not know the use for but might solve some issues: | |
| # mounting the host's system time (time sync host & container): | |
| # -v /etc/localtime:/etc/localtime | |
| xhost +local:docker # allows docker to connect to X11 display server | |
| docker run -d -it \ | |
| -v /tmp/.X11-unix:/tmp/.X11-unix \ | |
| -v /run/dbus:/run/dbus \ | |
| -e DISPLAY=$DISPLAY \ | |
| --name electron-dev \ | |
| node-dev:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:slim | |
| RUN apt-get update -y | |
| RUN apt-get install -y --no-install-recommends --no-install-suggests\ | |
| libgdk-pixbuf2.0-0 \ | |
| libgtk-3-0 \ | |
| libxss1 \ | |
| libasound2 \ | |
| libnss3 \ | |
| libx11-6 \ | |
| libx11-xcb1 \ | |
| libxcb1 \ | |
| libxcomposite1 \ | |
| libxcursor1 \ | |
| libxdamage1 \ | |
| libxext6 \ | |
| libxfixes3 \ | |
| libxi6 \ | |
| libxrandr2 \ | |
| libxrender1 \ | |
| libdrm2 \ | |
| libgbm1 \ | |
| libxtst6 \ | |
| libatk-bridge2.0-0 \ | |
| libnss3 \ | |
| libxcb-dri3-0 \ | |
| xauth \ | |
| ca-certificates \ | |
| dbus | |
| RUN apt-get clean | |
| RUN rm -rf /var/lib/apt/lists/* | |
| ENTRYPOINT [ "/bin/bash" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment