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


openspeedtest,docker,phpenv

Run OpenSpeedTest with phpenv

Although we may use websites such as speedtest to test the speed of uploading and uploading, what if we want to test the speed of our own Server? For example, if the user is in another country, the speed of connecting to our host is slow, then the self-hosted test tool is very convenient. The latest version of phpenv has added openspeedtest.yml to the yml file of services.

docker

How to update or rebuild D-Laravel's FPM Image

Sometimes, the docker image will undergo some corrections or add more plug-ins, how do we update the image in the computer? It's very simple, use docker pull [use the image], if you want to create your own image is also feasible...

linux,docker

How to execute X client and X Window in Container (docker gui)

Today I will talk to you about X, not iPhone X, nor X-Men, but X Window System, He is the main graphical interface display component of the current Linux system. Since it is very easy to expand and modularize, it has been used since it was established in 1986. The X Window system adopts the Client/Server architecture, which splits the application program and the display into two. The application program of X Windows is usually called X Client, and the display is the well-known X Server. The X client communicates with the X server through the X protocol (X protocol), which is an asynchronous network communication protocol.