Created
December 15, 2023 00:38
-
-
Save astrolemonade/62e9cd5229e07cb6e9bcd4a125bd0f16 to your computer and use it in GitHub Desktop.
Run QT5 gui app in Docker container
This file contains 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 ubuntu:bionic | |
RUN mkdir /app | |
COPY requirements.txt icons_rc.py main.py mainwindow_ui.py config.json /app/ | |
RUN apt-get update && \ | |
apt-get install -y python3 python3-pip xvfb libqt5x11extras5 && \ | |
pip3 install -r /app/requirements.txt |
This file contains 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
docker run -it \ | |
--user $(id -u) \ | |
-e DISPLAY=unix$DISPLAY \ | |
--workdir=/app \ | |
--volume="/home/$USER:/home/$USER" \ | |
--volume="/etc/group:/etc/group:ro" \ | |
--volume="/etc/passwd:/etc/passwd:ro" \ | |
--volume="/etc/shadow:/etc/shadow:ro" \ | |
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |
someone/something:version \ | |
python3 main.py --cfg config.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment