dockerTools.buildImage fails with "rsync:...Cannot allocate memory"

How much RAM do you have and how much is it filled right before the error?