Build fails with "getaddrinfo() thread failed to start"

We are using the muslrust image for our CI builds. These were recently upgraded from Ubuntu Xenial to Jammy. After this upgrade, CI is failing with a strange error getaddrinfo() thread failed to start, and later could not execute process rustc -vV (never executed). I only managed to reproduce the error on cloud_drone_io and my selfhosted drone_yerbamate_ml, but not locally. Now the latter seems to have fixed itself after some OS upgrades + reboot.

Here is the issue in muslrust repo

Do you have any idea how this problem could be fixed?