I'm just starting to play with Dagger on one of our monorepos, and I was taking the initial stance of "just copy the source of the repo into the container we're building" using client.filesystem.".".read and just reading the whole thing in.
This turns out to be not such a good idea and it took... forever 🙂 Particularly if the repo as a working repo contains "junk" like python virtual envs, build artifacts, etc. So... fine, the "right" thing is probably to copy in only the parts of the repo that matter for a particular task, but that can also get tedious for different reasons ("woops, forgot to copy this directory... ok, woops, forgot to copy this other directory...").
What's the best practice for a monorepo then? Try to "mount" the whole thing in read-only somehow? Copy only the parts needed for particular tasks? Just curious; trying to get this to play nicely with the established build tools (pants, bazel, etc) is also... just tricky.