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


vpn,cli,macos

How do I dial a VPN from the command line on MacOS

I myself will need to use MacOS to dial VPN in the command line. Here I provide my alias and setting method

MacOS

Find the ip location of MacOS

How to Find Your Mac's Location

docker,phpenv

Ran out of Docker IPv4 address pool problem solving

Maybe in the old version of the docker environment, when using Docker compose to start the container, you will encounter the following error: Error response from daemon: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network This is actually this It is a symptom of running out of default-address-pools. In some environments, docker-compose will use the private network of Class B by default. The private IP of segment 172 has a range, from 172.16.0.0 to 172.31.255.255. That is to say, when we start a docker-compose Project, it will eat a private section of Class B, which is very heroic.