|
| 1 | +# docker-compose example |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +The example provided [docker-compose file](docker-compose.yml) allows for: |
| 6 | +* building the container, |
| 7 | +* running the container in `NFS v4` mode only (`NFS v3` is disabled) - see more |
| 8 | + in the |
| 9 | + [customize NFS versions](../advanced/nfs-versions.md#customize-nfs-versions-offered) |
| 10 | + |
| 11 | +Following stuff gets mounted into the container: |
| 12 | + |
| 13 | +* `nfs-export` directory: |
| 14 | + |
| 15 | +``` |
| 16 | +nfs-export |
| 17 | +└── debian |
| 18 | + ├── a |
| 19 | + ├── b |
| 20 | + ├── c |
| 21 | + └── d |
| 22 | +``` |
| 23 | + |
| 24 | +* `exports.txt` file: |
| 25 | + |
| 26 | +``` |
| 27 | +/export *(rw,fsid=0,no_subtree_check,sync) |
| 28 | +/export/debian *(rw,nohide,insecure,no_subtree_check,sync) |
| 29 | +``` |
| 30 | + |
| 31 | +## Build |
| 32 | + |
| 33 | +In order to build the container: |
| 34 | + |
| 35 | +``` |
| 36 | +docker-compose build |
| 37 | +``` |
| 38 | + |
| 39 | +## Run |
| 40 | + |
| 41 | +In order to run the container: |
| 42 | + |
| 43 | +``` |
| 44 | +docker-compose up |
| 45 | +``` |
| 46 | + |
| 47 | +## Test |
| 48 | + |
| 49 | +Check if we can mount the directory: |
| 50 | + |
| 51 | +``` |
| 52 | +sudo mount LOCAL_IP:/ /mnt -v |
| 53 | +``` |
| 54 | + |
| 55 | +In the command output we can inspect which `NFS` version was used: |
| 56 | + |
| 57 | +``` |
| 58 | +mount.nfs: timeout set for Thu Jan 31 16:16:20 2019 |
| 59 | +mount.nfs: trying text-based options 'vers=4.2,addr=LOCAL_IP,clientaddr=LOCAL_IP' |
| 60 | +``` |
| 61 | + |
| 62 | +Inspect mounted directory content: |
| 63 | + |
| 64 | +``` |
| 65 | +/mnt |
| 66 | +└── debian |
| 67 | + ├── a |
| 68 | + ├── b |
| 69 | + ├── c |
| 70 | + └── d |
| 71 | +``` |
| 72 | + |
| 73 | +## Possible issues |
| 74 | + |
| 75 | +In case of the: |
| 76 | + |
| 77 | +``` |
| 78 | +nfs-server | ================================================================== |
| 79 | +nfs-server | STARTING SERVICES ... |
| 80 | +nfs-server | ================================================================== |
| 81 | +nfs-server | ----> mounting rpc_pipefs filesystem onto /var/lib/nfs/rpc_pipefs |
| 82 | +nfs-server | mount: mounting rpc_pipefs on /var/lib/nfs/rpc_pipefs failed: Permission denied |
| 83 | +nfs-server | ----> |
| 84 | +nfs-server | ----> ERROR: unable to mount rpc_pipefs filesystem onto /var/lib/nfs/rpc_pipefs |
| 85 | +nfs-server | ----> |
| 86 | +``` |
| 87 | + |
| 88 | +Please refer to the [apparmor document](../feature/apparmor.md#apparmor). |
0 commit comments