Getting can't start new thread Error for building docker image

See my answer here: RuntimeError: can't start new thread - #2 by asofyan