Running the GEANT4 examples in a Docker container

Hello!

I’d like to run the “microelectronics” from the shared Geant4 examples from the docker container. After cmake and make I have an executable file in the build directory, however, when I run it, it returns the error:

/home/geant4/microelectronics/microelectronics_build# ./microelectronics
Available UI session types: [ Qt, tcsh, csh ]
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)

Is it a problem with my current Qt installation outside the container? Please help to find the reason or provide me with another way of running it. Thanks!

The whole output is listed below:

root@g4see:/home/geant4/microelectronics/microelectronics_build# cmake -DGeant4_DIR=$G4LIB ../
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Found XercesC: /usr/lib/x86_64-linux-gnu/libxerces-c.so (found suitable version "3.2.3", minimum required is "3.2.3") 
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found Geant4: /opt/geant4/install/lib/Geant4-11.0.3/Geant4Config.cmake (found version "11.0.3") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/geant4/microelectronics/microelectronics_build
root@g4see:/home/geant4/microelectronics/microelectronics_build# make
Scanning dependencies of target microelectronics
[  7%] Building CXX object CMakeFiles/microelectronics.dir/microelectronics.cc.o
[ 14%] Building CXX object CMakeFiles/microelectronics.dir/src/ActionInitialization.cc.o
[ 21%] Building CXX object CMakeFiles/microelectronics.dir/src/DetectorConstruction.cc.o
[ 28%] Building CXX object CMakeFiles/microelectronics.dir/src/DetectorMessenger.cc.o
[ 35%] Building CXX object CMakeFiles/microelectronics.dir/src/ElectronCapture.cc.o
[ 42%] Building CXX object CMakeFiles/microelectronics.dir/src/G4ElectronCapture.cc.o
[ 50%] Building CXX object CMakeFiles/microelectronics.dir/src/MicroElecPhysics.cc.o
[ 57%] Building CXX object CMakeFiles/microelectronics.dir/src/MicroElecSiPhysics.cc.o
[ 64%] Building CXX object CMakeFiles/microelectronics.dir/src/PhysicsList.cc.o
[ 71%] Building CXX object CMakeFiles/microelectronics.dir/src/PrimaryGeneratorAction.cc.o
[ 78%] Building CXX object CMakeFiles/microelectronics.dir/src/RunAction.cc.o
[ 85%] Building CXX object CMakeFiles/microelectronics.dir/src/SteppingAction.cc.o
[ 92%] Building CXX object CMakeFiles/microelectronics.dir/src/TrackingAction.cc.o
[100%] Linking CXX executable microelectronics
[100%] Built target microelectronics
root@g4see:/home/geant4/microelectronics/microelectronics_build# ll
total 38992
-rw-r--r-- 1 root root    29789 Aug 12 09:44 CMakeCache.txt
drwxr-xr-x 5 root root     4096 Aug 12 09:45 CMakeFiles
-rw-r--r-- 1 root root    20113 Aug 12 09:44 Makefile
-rw-r--r-- 1 root root     2509 Aug 12 09:44 cmake_install.cmake
-rwxr-xr-x 1 root root 39846736 Aug 12 09:45 microelectronics
-rw-r--r-- 1 root root      131 Aug 12 09:44 microelectronics.in
-rw-r--r-- 1 root root      634 Aug 12 09:44 microelectronics.mac
-rw-r--r-- 1 root root     1435 Aug 12 09:44 plot.C
-rw-r--r-- 1 root root     2302 Aug 12 09:44 vis.mac
root@g4see:/home/geant4/microelectronics/microelectronics_build# ./microelectronics
Available UI session types: [ Qt, tcsh, csh ]
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)