When running docker dev environment with Linux and Windows (with WSL2), it’s already in the same container context so the performance is decent. However, on Mac there’s no WSL2 equivalent so bind mounts are painfully slow due to the overhead of translation between the Mac’s and container filesystem.
Is there any way to run the code in docker VM like WSL2 allows?

  • Depending on the Mac you’re using you can set up a VM directly using a hypervisor like VirtualBox or UTM to help improve performance. However if you’re trying to run a production application on a MacBook using docker you’re going to have a bad time. If you’re trying to performance test you’re better off trying to set up a cloud instance in Amazon using Linux to get better performance