Using opencv and python only successful when called from Command Line in container

Hi there,

I am having an issue calling a python file script that uses opencv-python libs.
When i docker exec -it image-id /bin/bash into the container, then call python script everything works fine.

However when i call the python script either directly with a CMD command from the Dockerfile or with .sh script via an ENTRYPOINT command, i get a failure. Even when i set the shebang of the .sh script to /bin/bash

The error comes from opencv. I have posted in their forum for some help, but I am wondering what differences there are in the calling structure/mechanism when calling the scripts in the difference ways i have outlined above, using CMD or .sh script via ENTRYPOINT

As far as i can tell docker will runs something like /bin/sh -c "run this command"

I have no idea why this might be happening and any ideas are welcome.

Thanks in advance,
Wilson