Sign inSign up

fadawar/docker-pyqt5

By fadawar

•Updated almost 6 years ago

Dockerfile for development GUI application with Python 3 + PyQt5

Image
5

10K+

fadawar/docker-pyqt5 repository overview

⁠docker-pyqt5

Dockerfile for development of GUI applications with Python 3 + PyQt5

Tested on Ubuntu 20.04

Links: GitHub repo⁠, Docker Hub⁠

⁠How to use it on Linux

You can test if everything works with the small testing app included in this docker image. You can try it with:

docker run --rm -it \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$DISPLAY \
    -u qtuser \
    jozo/pyqt5 python3 /tmp/hello.py

You should see a window similar to this:

Screenshot

⁠How to use it on MacOS

  1. Install XQuartz⁠. Restart OS.
  2. In XQuartz: Check the option: XQuartz -> Preferences -> Security -> "Allow connections from network clients"
  3. Run in terminal:
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
xhost +

You can test if everything works with the small testing app included in this docker image. You can try it with:

docker run --rm -it \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=$IP:0 \
    -u qtuser \
    jozo/pyqt5 python3 /tmp/hello.py

⁠Other Dockerfiles

Python 3 + PyQt5: https://github.com/jozo/docker-pyqt5⁠

Python 3 + PyQt5 + QML: https://github.com/jozo/docker-pyqt5-qml⁠

Python 3 + PyQt5 + QML + QtMultimedia: https://github.com/jozo/docker-pyqt5-qml-qtmultimedia⁠

Build locally

docker build -t fadawar/pyqt5 .

Tag summary

Content type

Image

Digest

Size

170.2 MB

Last updated

almost 6 years ago

docker pull fadawar/docker-pyqt5