Trying to detect version information or package information statically can have lots of issues. If something runs via CLI you could potentially extract package or version information via common command line arguments like -v.
Describe the solution you'd like
Using QEMU in Docker would allow the feature to be less OS-dependent.