I tried to make the question as reproducible as possible. So here is the docker commands:
docker run --name headless_test -ti python:3.6-jessie /bin/bash
And inside the docker execute the following lines:
apt update && apt install -y git xvfb xorg-dev cmake
pip3 install glfw
mkdir /projects
git clone https://github.com/glfw/glfw.git /projects/glfw
cd /projects/glfw
cmake -DBUILD_SHARED_LIBS=ON .
make
export PYGLFW_LIBRARY=/projects/glfw/src/libglfw.so
xvfb-run python -c "import glfw; glfw.init(); glfw.window_hint(glfw.VISIBLE, False); glfw.create_window(100, 100, 'hidden window', None, None)"
this fails with the following error:
GLX: Failed to find a suitable GLXFBConfig
executing xvfb-run glxinfo
(after installing mesa-utils
) returns the following:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Error: couldn't find RGB GLX visual or fbconfig
EDIT: This works great if I use the ubuntu
docker
apt install libgl1-mesa-glx
changes nothing) – Centiliter