Mounting nfs shares inside docker container

Starting from docker 17.06, you can mount NFS shares to the container directly when you run it, without the need of extra capabilities export NFS_VOL_NAME=mynfs export NFS_LOCAL_MNT=/mnt/mynfs export NFS_SERVER=my.nfs.server.com export NFS_SHARE=/my/server/path export NFS_OPTS=vers=4,soft docker run –mount \ “src=$NFS_VOL_NAME,dst=$NFS_LOCAL_MNT,volume-opt=device=:$NFS_SHARE,\”volume-opt=o=addr=$NFS_SERVER,$NFS_OPTS\”,type=volume,volume-driver=local,volume-opt=type=nfs” \ busybox ls $NFS_LOCAL_MNT Alternatively, you can create the volume before the container: docker volume create \ … Read more

Ways to improve git status performance

To be more precise, git depends on the efficiency of the lstat(2) system call, so tweaking your client’s “attribute cache timeout” might do the trick. The manual for git-update-index — essentially a manual mode for git-status — describes what you can do to alleviate this, by using the –assume-unchanged flag to suppress its normal behavior … Read more

Vagrant error : Failed to mount folders in Linux guest

The plugin vagrant-vbguest solved my problem: $ vagrant plugin install vagrant-vbguest Output: $ vagrant reload ==> default: Attempting graceful shutdown of VM… … ==> default: Machine booted and ready! GuestAdditions 4.3.12 running — OK. ==> default: Checking for guest additions in VM… ==> default: Configuring and enabling network interfaces… ==> default: Exporting NFS shared folders… … Read more

inotify with NFS

inotify requires support from the kernel to work. When an application tracks a directory, it asks the kernel to inform it when those changes occur. When the change occurs, in addition to writing those changes to disk, the kernel also notifies the watching process. On a remote NFS machine, the change is not visible to … Read more

C# int to byte[]

The RFC is just trying to say that a signed integer is a normal 4-byte integer with bytes ordered in a big-endian way. Now, you are most probably working on a little-endian machine and BitConverter.GetBytes() will give you the byte[] reversed. So you could try: int intValue; byte[] intBytes = BitConverter.GetBytes(intValue); Array.Reverse(intBytes); byte[] result = … Read more