docker-nfs

command module
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 2 Imported by: 0

README

docker-nfs

CircleCI

configuration automation tools for docker nfs.

Installation

$ go get github.com/katsew/docker-nfs

Usage

exports
$ sudo docker-nfs exports --addr 192.168.33.10

Auto configuration cli for native nfs configuration. Command will do the following actions:

  1. Insert config (or create new) /etc/exports
  2. Insert config (or create new) /etc/nfs.conf
  3. Restart nfsd if at least one of the file appears above updates

⚡ Use this command with sudo or your config file will accidentally update!

e.g.

$ cd /path/to/your/docker/project
$ sudo docker-nfs exports --addr 192.168.33.10
$ cat /etc/exports

# BEGIN - docker-nfs [uid]:[gid]
"/path/to/your/docker/project" 192.168.33.10 -rw -alldirs -mapall=[uid]:[gid]
# END - docker-nfs [uid]:[gid]

$ cat /etc/nfs.conf

## BEGIN - docker-nfs
nfs.server.mount.require_resv_port = 0
## END - docker-nfs

nfsd will be restarted

create-volume
$ docker-nfs create-volume --name project_local

Create docker volume with type nfs for current directory

e.g.


$ docker-nfs create-volume --name project_local
$ docker volume inspect project_local

[
    {
        "CreatedAt": "",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/project_local/_data",
        "Name": "project_local",
        "Options": {
            "device": ":/path/to/your/docker/project",
            "o": "addr=host.docker.internal,rw",
            "type": "nfs"
        },
        "Scope": "local"
    }
]

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
pkg
common
TODO: find more better package to put error struct
TODO: find more better package to put error struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL