The docker volume create reference implies that you can docker volume create --driver local and create a Docker volume that is a specific mounted filesystem. There’s even a specific example for NFS there.
I haven’t tested this specifically, but I think it should look roughly like the following:
I’m pretty sure starting a container just to provide a volume isn’t considered a best practice any more (I do see it mentioned as an example in the documentation, though).
Given that your previous step build: a container from source, I’d definitely include your application in the container and not try to “inject” it into the container like this.
don’t forget that in order to use NFS the Docker host would need nfs-client and nfs-common modules installed. This is not the case for all Docker hosts running on Moby Linux - docker for mac , aws and windows