by Devin Yang
(This article was automatically translated.)

Published - 5 years ago ( Updated - 5 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


docker, goaccess, config

phpenv actual combat GoAccess is real website analysis (docker version)

Before I start, let me say that GoAccess can also generate static data as long as you have a log, because I think the real-time feeling is more dazzling, so this article will focus on the part of GoAccess real-time display. Although Google Analytics (GA) is very useful, it is also very good to try another GA. For example, you want to know which browsers website users use to visit the website.

docker,container,laravel

Manually update the full record of D-Laravel's user id on Nas

This article fully records how I update the uid of the fpm image on my Nas. In this article, you should learn to query related concepts such as container id and commit container.

laravel,docker

How to customize Laravel pagination

Recently, I have been free, and I want to adjust the arrows on the upper and lower pages of the website. If you don’t know how to customize Laravel’s pagination, You can take a look at a short three-minute introduction on how I customize Laravel's pagination.