Due to the way that Docker evaluates environment variable definitions, PROD_LIBS is not in scope when PYTHONPATH is set, and therefore the site-packages under /build/prod doesn't end up in the PYTHONPATH. This results in dependencies needed by custom drivers not being available in the run time.
You can verify this outcome by running the following:
The
driver/Dockerfile
template has the following definition:Due to the way that Docker evaluates environment variable definitions,
PROD_LIBS
is not in scope whenPYTHONPATH
is set, and therefore thesite-packages
under/build/prod
doesn't end up in thePYTHONPATH
. This results in dependencies needed by custom drivers not being available in the run time.You can verify this outcome by running the following:
result:
The fix is to break out the definition of
PROD_LIBS
into a separate layer: