Configuring Docker for Mac to use swap

I have roughly 20 containers running on a MacBookPro, with 5GB RAM allocated to Docker.

I have set a memory limit on each container to 150mb, with --memory_swap either set to -1 or not specified. Either way, containers progressively stop, with no error message in the logs and with the only hint being the error code 137, which I believe reflects a kill -9 (due to OOM?)

Is there anything that can be done to take advantage of swap space?

I’m on macOS 10.12.3, Docker 1.13.0.

BTW, when I lift the memory restrictions, I see exit code 134.

I know about restart - I’ve turned it off so I can catch the exit code.

I’ve seen this too. It looks like an issue with memory over provisioning and lack of swap space as compared to previous versions of Docker for Mac. You can work around the issue with the steps described here, Docker for mac configure swap space but I can’t figure out how to save the values beyond restart of Docker.