sjiveson / nfs-server-alpine

A handy Alpine Linux based NFS Server image running NFS v4 only, over TCP on port 2049
https://hub.docker.com/r/itsthenetwork/nfs-server-alpine/
GNU General Public License v3.0
292 stars 185 forks source link

Add more flexible options #23

Open colearendt opened 5 years ago

colearendt commented 5 years ago

Would love to discuss if this is workable from your perspective and how committed you are to backwards compatibility. I think if backwards compatibility is not necessary, these deprecation warnings could be more forceful or you can simply bump the version and simplify the pattern by setting default NFS_OPTS and give users free reign to set their own options by overriding the environment variable.

NOTE: I submitted the PR to the byebyeconfd branch, since those changes looked desirable and these changes are related.

Related to #20 Related to #22

sjiveson commented 5 years ago

Hey Cole, thank you for this, it looks great. I wasn't aware of the ability to use SET_OPTS et al.

I'd like to both understand more about these env vars and get the removal of confd done before I consider merging this. I can't say when that will be but hopefully in a week r s.

Backwards compatibility is definitely important btw.

Also can you explain why you think this helps with https://github.com/sjiveson/nfs-server-alpine/issues/22

colearendt commented 5 years ago

Thanks for the response! So a bit of an overview how all of this works, in case it helps:

Previously: you use options to swap out a template using sed, and create a separate template for SHARED_DIRECTORY_2 Current approach: use an environment variable (NFS_OPTS or SET_OPTS) to set all NFS options for all shares (since you can have an arbitrary number). These shares are all added in sequence to the /etc/exports file

How backwards compatibility is maintained:

Specifically, #22 is related because NFS_OPTS makes it very natural to change all NFS parameters at runtime, rather than requiring a rebuild of the docker image.

What are your thoughts on:

colearendt commented 5 years ago

Oh, also. ${PERMITTED} is used verbatim, since it is kinda independent of NFS_OPTS. It still defines PERMITTED=* if PERMITTED is not defined, again for backwards compatibility.

# In order to run a `READ_ONLY`, `SYNC` version in the new paradigm:
docker run \
  -e "PERMITTED=1.2.3.4" \
  -e "NFS_OPTS=ro,sync,fsid=0,no_subtree_check,no_auth_nlm,insecure,no_root_squash" \
  dockerimage /var/share

# In order to solve #22 , along with READ_WRITE and ASYNC
docker run \
  -e "PERMITTED=*" \
  -e "NFS_OPTS=rw,async,fsid=0,no_subtree_check,no_auth_nlm,insecure" \
  dockerimage /var/share /var/share2

If you like this approach, I am happy to do some work updating the README.

sjiveson commented 5 years ago

Thanks!

colearendt commented 5 years ago

@sjiveson Do you mind clarifying a bit about why you closed? Did you decide that this functionality is not desirable?

sjiveson commented 5 years ago

Ah sorry, its been that long I forgot you did this PR against the byebyeconfd branch, which I just merged into the arm branch (months after originally merging to master) and then deleted.

sjiveson commented 5 years ago

Just recreated the branch and managed to reopen, phew. Hopefully I'll actually find the time to give this the attention it deserves.

colearendt commented 5 years ago

Thanks!! No worries! I’ll take some time to pull in the latest from master too. 😄

KenjiTakahashi commented 5 years ago

Hey guys, what is the status on this? I could use some of these changes, too. Thanks! (Yes, I know I can build my own image, but it is a bit troublesome ;-].)

jforest commented 1 year ago

I would also love it if this could get merged.. it's a very useful update

saymonaraujo commented 11 months ago

This PR is mentioned multiple times in multiple issues. Is there any intention in create a version using this ?