Search code examples
dockergtkgnuradiognuradio-companion

GNURadio in docker: Gtk.StyleContext.add_provider_for_screen( TypeError: Argument 0 does not allow None as a value


I am trying to run a GNURadio Companion inside a docker container. However, no matter what Docker I use, all containers exit when I call gnuradio-companion command with the same error:

Unable to init server: Could not connect: Connection refused
Traceback (most recent call last):
  File "/usr/bin/gnuradio-companion", line 102, in <module>
run_main()
  File "/usr/bin/gnuradio-companion", line 95, in run_main
    exit(main())
  File "/usr/lib/python3/dist-packages/gnuradio/grc/main.py", line 81, in main
    from .gui.Platform import Platform
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/Platform.py", line 26, in <module>
    from . import canvas
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/canvas/__init__.py", line 21, in <module>
    from .param import Param
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/canvas/param.py", line 23, in <module>
    from .. import ParamWidgets, Utils, Constants
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 69, in     <module>
    add_style_provider()
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 64, in            add_style_provider
Gtk.StyleContext.add_provider_for_screen(
TypeError: Argument 0 does not allow None as a value

The Dockerfiles/images that I used:

https://github.com/laurybueno/docker-gnuradio/blob/master/3.7/Dockerfile

https://github.com/git-artes/docker-gnuradio/blob/master/gnuradio-releases/Dockerfile

https://hub.docker.com/r/bistromath/gnuradio/tags

https://hub.docker.com/r/librespace/gnuradio

From what I have found this error occurs when some dependencies are missing, however thats exactly why I have decided to use Docker. So that I have all dependencies needed within container. I kindly ask for you help. I would like to resolve this error but I have run out of ideas. At this point I am asking myself an additional question: how is that even possible that multiple different images fail with exactly the same error?


Solution

  • This isn't an issue of missing dependencies.

    You need a display server connection in order to run a GTK application. Running a graphical application under Docker isn't a great idea. GTK developers recommend using Flatpak as a container technology for desktop applications.