You might need to increase the memory available to ZAP and/or docker.
You might need to do some playing around as you'll need to get the .ZAP_JVM.properties file updated before calling zap.sh
Increasing the memory available to docker will depend on which platform you are running it on.
I know I had to do that on my Mac book, I just googled it ;)
Cheers,
simon