dinghy
dinghy copied to clipboard
support configuring multiple NFS mounts
I would like to have access to an external disk mounted in /Volumes/Development but I can't figure out how to mount in an xhyve docker machine?
I merged a PR a while back to support changing the share using some env vars (https://github.com/codekitchen/dinghy/blob/master/cli/dinghy/unfs.rb#L50), but there's not currently support for mounting more than one share.
Probably the best way to make this work would be to always mount the home dir, and allow a list of additional mounts to be specified in the ~/.dinghy/preferences.yml file.
You may be able to work around by setting up symlinks or hard links to the shared guest directory.
@Hengjie Can you elaborate? I'm not sure how a symbolic link would help, as it would just resolve to a non-accessible directory. Directory hard-links are an abomination reserved for use by Time Machine.
This feature is kind of crucial for working with Node/NPM, as it breaks the ability to globally link (and develop) non-published npm dependencies with consuming projects. 🙁
For my use case, all that's needed is a way to link the /usr/local/lib/node_modules directory in addition to the user's home directory.
Btw, if anyone comes across this and needs am immediate work-around, you can install and use nvm, globally link with that (remember to wipe out your node_modules directory), then manually edit the created symbolic links so they're absolute instead of relative. Finally, make sure your actual docker command (or docker-compose.yml file) links $HOME:$HOME, and it should work. Ugly, but at least possible.
I don't have a lot of experience with npm, but for unpublished ruby gems we typically pull them in as a git submodule. Is that not an option with npm?
You could also use a hard directory link rather than a symlink, I suppose.
Well, it's not a good option, considering the use case (active development). I wouldn't want to have to commit + push code just to test it, ya know? That's the use case of npm link – it lets you fake-install a working directory as a dependency, and continue on your merry way. Unfortunately, npm link breaks when the /usr/local/lib/node_modules directory isn't present within the Docker container.
Adding support for mounting multiple directories would solve the underlying issue. 🙂
What I mean is that we typically use a submodule, and do development on the gem directly in the submodule so that we don't need to commit or push to test things. But yes I'm just proposing alternatives, I'd be happy to see somebody implement easy support for multiple mounts.