by Devin Yang
(This article was automatically translated.)

Published - 4 years ago ( Updated - 4 years ago )

Instructions for NFS mounting on D-Laravel:
volumes:
  sites:
    driver: local
    driver_opts:
      type: nfs
      o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
      device: ":/Users/devin/dlaravel/sites"
In the device project above, I use the absolute path of the sites, so that there will be no problems in the state of the console alias.
The settings of your default settings will be as follows: (represents the start of docker-compose to be executed on the D-Laravel directory)
device: ":${PWD}/sites"
For the NFS settings of D-Laravel, you can refer to the link below:
https://www.ccc.tc/notes/nfs-docker-and-laravel

Record some parameters used on NFS

nolock
Select whether to use the NLM sideband protocol to lock files on the server. If no options are specified (or no locking is specified), NLM locking is used for this mount point. When using the nolock option, applications can lock files, but such locking only provides exclusion to other applications running on the same client. Remote applications are not affected by these locks.

When /var is mounted using NFS, NLM locking must be disabled with the nolock option, because /var contains files used by the NLM implementation on Linux. The nolock option is also required when mounting exports on NFS servers that do not support the NLM protocol.
soft/hard
Determines the recovery behavior of the NFS client after an NFS request times out. If no options are specified (or the hard option is not specified), NFS requests will be retried indefinitely. If the soft option is specified, the NFS client will fail the NFS request after sending the retransmission, causing the NFS client to return an error to the calling application.

Note: In some cases, so-called "soft" timeouts may cause silent data corruption. Therefore, use the soft option only when client responsiveness is more important than data integrity. Some of the risks of using the soft option can be mitigated by using NFS over TCP or by increasing the value of the retrans option.
intr/nointr
Choose whether to allow signals to interrupt file operations on this mount point. If no options are specified (or nointr is specified), the signal does not interrupt NFS file operations. If intr is specified, the system call will return EINTR when an in-progress NFS operation is interrupted by a signal.

Others are too simple, you can guess it if you think about it, rw is readable and writable. nfsvers=3 use nfs3 to mount,

Tags: docker nfs macos

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


d-laravel, docker, docker-compose, laravel

D-Laravel released v0.9.1 version

In order to keep D-Laravel in an operational version and a stable version. Start tagging this version Pass those tests.. This version has passed the ubuntu real and macos real machine tests, and the Container can be successfully established and executed..

certbot,docker,ftp

curlftpfs introduction and manual certificate application

Situation sharing, imagine that you have WebHosting, which only provides FTP connection, and then you want to apply for a certificate manually. In this article, I share how I use Docker to install curlftpfs, mount the FTP folder of the remote host, and then execute certbot in the container to apply for an SSL certificate. Leaving aside the certificate application, when I first discovered the curlftpfs command, I found it very interesting, especially if you are a MacOS user and do not have a satisfactory FTP software at hand. You love scrolling through the command line as much as I do, so maybe you should love this command too. 🤭