Bogus entries in default PATH
The default PATH in a container is
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/usr/sbin
, /sbin
and /bin
should not be there: they are symlinks to /usr/bin
and having them in PATH is known to cause issues with cmake and autotools (they don't resolve symlinks so they detect binaries in the symlinked path, then they try to set other paths relative to that which fails).