これはコンテナ起動します。
docker run --rm --net=host --privileged -v $PWD:/home -e SHARED_DIRECTORY=/home itsthenetwork/nfs-server-alpine
このときのログは以下です。
$ docker run --rm --net=host --privileged -v $PWD:/home -e SHARED_DIRECTORY=/home itsthenetwork/nfs-server-alpine Writing SHARED_DIRECTORY to /etc/exports file The PERMITTED environment variable is unset or null, defaulting to '*'. This means any client can mount. The READ_ONLY environment variable is unset or null, defaulting to 'rw'. Clients have read/write access. The SYNC environment variable is unset or null, defaulting to 'async' mode. Writes will not be immediately written to disk. Displaying /etc/exports contents: /home *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash) Starting rpcbind... Displaying rpcbind status... program version netid address service owner 100000 4 local /var/run/rpcbind.sock - superuser 100000 3 local /var/run/rpcbind.sock - superuser Starting NFS in the background... rpc.nfsd: knfsd is currently down rpc.nfsd: Writing version string to kernel: -2 -3 +4 +4.1 +4.2 rpc.nfsd: Created AF_INET TCP socket. rpc.nfsd: Created AF_INET6 TCP socket. Exporting File System... exporting *:/home /home <world> Starting Mountd in the background...These Startup successful.
次に以下だと起動しません。
docker run --rm --net=host --privileged -e SHARED_DIRECTORY=/home itsthenetwork/nfs-server-alpine
ログは以下です。
$ docker run --rm --net=host --privileged -e SHARED_DIRECTORY=/home itsthenetwork/nfs-server-alpine Writing SHARED_DIRECTORY to /etc/exports file The PERMITTED environment variable is unset or null, defaulting to '*'. This means any client can mount. The READ_ONLY environment variable is unset or null, defaulting to 'rw'. Clients have read/write access. The SYNC environment variable is unset or null, defaulting to 'async' mode. Writes will not be immediately written to disk. Displaying /etc/exports contents: /home *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash) Starting rpcbind... Displaying rpcbind status... program version netid address service owner 100000 4 local /var/run/rpcbind.sock - superuser 100000 3 local /var/run/rpcbind.sock - superuser Starting NFS in the background... rpc.nfsd: knfsd is currently down rpc.nfsd: Writing version string to kernel: -2 -3 +4 +4.1 +4.2 rpc.nfsd: Created AF_INET TCP socket. rpc.nfsd: Created AF_INET6 TCP socket. Exporting File System... exporting *:/home exportfs: /home does not support NFS export Export validation failed, exiting...
これはなぜでしょうか。
差異はvolumeでディレクトリをマウントするかしないかだと思いますが、コンテナ的にはどっちも変わらないという認識を持っていますが、間違っていますか?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/10/21 12:22