Why are bind mounts slow on Docker Desktop for Mac/Windows and what helps?
IntermediateConceptVolumes & Bind Mounts
Answer
File access crosses the VM boundary (virtiofs, gRPC-FUSE, or the WSL2 9P bridge), which is slow for many small files like node_modules. Keep source on the Linux filesystem in WSL2, use named volumes for dependency directories, enable VirtioFS on Mac, and use Compose watch (sync) instead of full bind mounts.
More on Volumes & Bind Mounts
What are the three ways to persist or share data with a container?BeginnerVolume vs bind mount: when do you pick which?BeginnerWhat is the difference between `-v` and `--mount`?BeginnerWhat is an anonymous volume and how do you find leftovers?IntermediateHow does a new named volume get populated?IntermediateHow do you back up and restore a named volume?Intermediate