How to run Binary Ninja in a Docker container? #6835
-
I'm attempting to run Binary Ninja in a headless Docker container (without GUI) to use its Python API for automation tasks. However, the application fails to start due to Qt/XCB errors (pasted below), likely because the container lacks a display. While we understand the GUI requires X11 configuration, our primary goal is to configure the license and use the API in a headless environment. Currently, the crash prevents even license setup.
Could you provide some configuration guidance for running it in a Docker container? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
If you have a commercial or headless license, you can install it by manually dropping the license.dat file at |
Beta Was this translation helpful? Give feedback.
-
https://docs.binary.ninja/dev/batch.html#on-disk-license The second was explicitly added for docker instances. |
Beta Was this translation helpful? Give feedback.
-
Also, in the future, please file questions like this as discussion items, not issues. |
Beta Was this translation helpful? Give feedback.
-
Hello, I followed the above suggestion to use core_set_license, and the code is as follows. However, when running it, I encountered the error:
|
Beta Was this translation helpful? Give feedback.
If you have a commercial or headless license, you can install it by manually dropping the license.dat file at
~/.binaryninja/license.dat
. You can then either use the includedscripts/install_api.py
script to install the python api in your python interpreter or virtual environment, or setPYTHONPATH
to thepython
folder in the install. We have done this for dogbolt, see here: https://github.com/decompiler-explorer/decompiler-explorer/blob/master/runners/decompiler/Dockerfile#L26-L43