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


php,docker,dlaravel

A brief introduction to the phpenv container environment I built

I don't have time to shoot an introduction video, so I'll just grab some pictures and introduce the container environment deviny/phpenv I use. https://github.com/DevinY/phpenvphpenv can be regarded as an evolutionary version of my previous D-Laravel open source project, conceptually extending the use of many Dlaravel operation methods. The update of the container tends to be controlled by the user to build his own image, so I am not very good at changing the version number. In fact, the php version number of D-Laravel seems to have not been changed for a long time:p

docker

About how to change the owner of FPM image on GCE

The CCC website has been upgraded to php 7.2.0. With a Docker environment, it is easy to upgrade php. There are still some precautions you should know about the change of Image on Linux. If you install D-Laravel on a Linux system through docker like me, when you change a different image, Perhaps you may encounter, doubt! Why composer does not have permission to write to the folder error. directory is not writable

docker,Synology

How to modify the logging driver of Docker on Synolog NAS

On my Synolog Nas, a strange logging driver named db is running by default, how to modify it to a normal json-file? In Synolog's Nas, his Daemon config file is special, and it is placed in the /var/packages/Docker/etc/ directory. Called dockerd.json.