diff --git a/test/images/volumes-tester/nfs/Dockerfile b/test/images/volumes-tester/nfs/Dockerfile index 9e210f0272f..fc895178f23 100644 --- a/test/images/volumes-tester/nfs/Dockerfile +++ b/test/images/volumes-tester/nfs/Dockerfile @@ -17,9 +17,10 @@ MAINTAINER Jan Safranek, jsafrane@redhat.com RUN yum -y install /usr/bin/ps nfs-utils && yum clean all RUN mkdir -p /exports ADD run_nfs.sh /usr/local/bin/ -ADD index.html /exports/index.html -RUN chmod 644 /exports/index.html +ADD index.html /tmp/index.html +RUN chmod 644 /tmp/index.html -EXPOSE 2049/tcp +# expose mountd 20048/tcp and nfsd 2049/tcp +EXPOSE 2049/tcp 20048/tcp -ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports"] +ENTRYPOINT ["/usr/local/bin/run_nfs.sh", "/exports", "/"] diff --git a/test/images/volumes-tester/nfs/Makefile b/test/images/volumes-tester/nfs/Makefile index 348cba87a5f..69734d4e383 100644 --- a/test/images/volumes-tester/nfs/Makefile +++ b/test/images/volumes-tester/nfs/Makefile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -TAG = 0.5 +TAG = 0.6 PREFIX = gcr.io/google_containers all: push diff --git a/test/images/volumes-tester/nfs/run_nfs.sh b/test/images/volumes-tester/nfs/run_nfs.sh index 4d9f14ea30d..1714d352597 100755 --- a/test/images/volumes-tester/nfs/run_nfs.sh +++ b/test/images/volumes-tester/nfs/run_nfs.sh @@ -21,19 +21,29 @@ function start() for i in "$@"; do # fsid=0: needed for NFSv4 echo "$i *(rw,fsid=0,insecure,no_root_squash)" >> /etc/exports + # move index.html to here + /bin/cp /tmp/index.html $i/ + chmod 644 $i/index.html echo "Serving $i" done + + # start rpcbind if it is not started yet + /usr/sbin/rpcinfo 127.0.0.1 > /dev/null; s=$? + if [ $s -ne 0 ]; then + echo "Starting rpcbind" + /usr/sbin/rpcbind -w + fi mount -t nfsd nfds /proc/fs/nfsd - # -N 2 -N 3: disable NFSv2+3 - # -V 4.x: enable NFSv4 - /usr/sbin/rpc.mountd -N 2 -N 3 -V 4 -V 4.1 + # -N 4.x: disable NFSv4 + # -V 3: enable NFSv3 + /usr/sbin/rpc.mountd -N 2 -V 3 -N 4 -N 4.1 /usr/sbin/exportfs -r # -G 10 to reduce grace time to 10 seconds (the lowest allowed) - /usr/sbin/rpc.nfsd -G 10 -N 2 -N 3 -V 4 -V 4.1 2 - + /usr/sbin/rpc.nfsd -G 10 -N 2 -V 3 -N 4 -N 4.1 2 + /usr/sbin/rpc.statd --no-notify echo "NFS started" }