The limitation of this approach it that all project must reside on the same device as the pnpm store. There is no cross-device symlinks
Our workaround is to put the global cache in the project so we can mount it alongside the code in the same mountpoint.
I would argue building different containers from a shared node_modules is inherently dangerous anyway. Sounds like your ”workaround” is in fact pretty much the optimal setup for quickly performing multiple similar builds.
Do you mean hardlinks?