Created
May 14, 2022 20:35
-
-
Save pangyuteng/e7286fd461aad1c59cea69ce5558a63e to your computer and use it in GitHub Desktop.
docker nfs volume to respect default acl settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
RUN apt-get update;apt-get install acl -yq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker built -t acl . | |
docker rm -f $(docker ps -a -q) | |
docker volume rm $(docker volume ls -q) | |
export NFS_IP=420.69 | |
export NFS_FOLDER=myfolder | |
export NFS_NAME=mynfs | |
# nfs v4 does not show default perms, but v3 with acl flag shows default perms | |
docker volume create --driver local --opt type=nfs \ | |
--opt o=nfsvers=3,addr=$NFS_IP,rw,acl,async --opt device=:/$NFS_FOLDER $NFS_NAME | |
docker run -u $(id -u):$(id -g) -v $NFS_NAME:/mnt \ | |
-w /mnt acl bash -c "getfacl ." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment