docker: Fix issues arising after update to v5.7.0-RC2
Use proper CMake variables to enable building against either system python version 2 or 3, based on user-provided build-time argument.
Backport: release
Use proper CMake variables to enable building against either system python version 2 or 3, based on user-provided build-time argument.
Backport: release