Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I make custom NFS exports this permanent? #134

Closed
kourindouhime opened this issue Feb 10, 2016 · 5 comments
Closed

How do I make custom NFS exports this permanent? #134

kourindouhime opened this issue Feb 10, 2016 · 5 comments

Comments

@kourindouhime
Copy link

Hi, I'm here with an old problem, which you've marked as "won't fix". The problem is related to some of the docker images like postgresql, which can't run with a volume attached, because of unable to change permissions for data files problem.

d1cf4d9

^ I took a look on this commit, so I decided to replace exports options in ~/.dinghy/machine-nfs-exports-dinghy with
192.168.99.100(rw,no_root_squash)

and restarted nfs manually:

sudo /usr/local/sbin/unfsd -e /Users/danst/.dinghy/machine-nfs-exports-dinghy -n 19888 -m 19888 -l 192.168.99.1 -p -d

Tried running postgresql container and it was OK. It changed permissions to data folder, I can't access it with my usual user, but I can with root and I'm totally okay with it.

BUT if I do

dinghy restart

then somewhere on "Starting NFS daemon, this will require sudo" step, my "~/.dinghy/machine-nfs-exports-dinghy" file gets updated with rw,all_squash,anonuid=501,anongid=20.

How can I prevent this happening? Thank you.

@kourindouhime kourindouhime changed the title How do I make this permanent? How do I make custom NFS exports this permanent? Feb 10, 2016
@codekitchen
Copy link
Owner

It'll require a code change, I'm open to a PR that makes this a configurable option

@alexvb
Copy link

alexvb commented Feb 10, 2016

@codekitchen A feature called user namespaces has landed in the new docker release. Maybe it could be useful to get around all these ownership problems.

@codekitchen
Copy link
Owner

Yep! We've been following the development of user namespaces support for a long time hoping it'll be the true solution. There's still a lot of things to figure out though. Ideally I'd love to see the user in containers such as postgres mapped to the uid/gid of the OSX host user.

I haven't had a chance to dig in to the finalized feature yet, if you'd like to see what can be done with this first release that'd be awesome.

@kourindouhime
Copy link
Author

Alright, I've solved this with a horrible workaround:

75c75
<     #File.open(exports_filename, 'wb') { |f| f.write exports_body }
---
>     File.open(exports_filename, 'wb') { |f| f.write exports_body }

@codekitchen
Copy link
Owner

A PR for this was merged a while back, I'm going to close this: #170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants