I couldn't give you any advise on the memory size. But I do want to give a warning for Docker. If you plan to run Linux x86_64 images on these Apple Silcon machines, be prepared for surprises. They are quite slow. Perhaps Docker may use Rosetta 2 to simulate Intel programs (Linux) in future, but so far, QEMU is used and it's very slow compared with the aarch64 based Linux images.
I'm using a M1 Pro MBP 16" with 32G memory. Plenty for my work flow. I'm just using Docker to do cross compile for different targets (Windows, Linux and macOS as well (with osxcross)).
Oh boy. Thanks for that input. It's almost making me reconsider my purchase altogether. All of my containers to date are Linux images.