If you are using cv2 or opencv-python and then building the application through docker you will get an importerror: libgl.so.1: cannot open shared object file: no such file or directory.
The best solution is to install the - headless package
headless package does not have GUI dependencies, therefore it reduces the container image size.
1 | pip uninstall opencv-python |
Reference
[Solved] Importerror: libgl.so.1: cannot open shared object file: no such file or directory