Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 4353c71

Browse files
committed
adding additional AppArmor docs
1 parent 53c0077 commit 4353c71

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

doc/feature/apparmor.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
If your Docker host has [AppArmor](https://wiki.ubuntu.com/AppArmor) activated, you'll need to perform additional steps to allow the container to start an NFS server.
44

5-
1. Ensure you have the `apparmor-utils` installed package installed on the Docker host. e.g. for Debian:
5+
1. Ensure you have the `apparmor-utils` installed package installed on the Docker host. e.g. for Debian or Ubuntu:
66

77
$ sudo apt-get install apparmor-utils
88

@@ -15,16 +15,34 @@ If your Docker host has [AppArmor](https://wiki.ubuntu.com/AppArmor) activated,
1515
mount fstype=rpc_pipefs,
1616
}
1717
18-
1. Load this profile into AppArmor:
18+
1. Load this profile into the kernel with [`apparmor_parser`](http://manpages.ubuntu.com/manpages/xenial/man8/apparmor_parser.8.html):
1919

2020
$ sudo apparmor_parser -r -W /path/to/file/from/previous/step
2121

2222
1. Add `--security-opt apparmor=erichough-nfs` to your `docker run` command. e.g.
2323

2424
docker run \
25-
-v /path/to/exports.txt:/etc/exports:ro \
2625
-v /path/to/share:/nfs \
26+
-v /path/to/exports.txt:/etc/exports:ro \
2727
--cap-add SYS_ADMIN \
2828
-p 2049:2049 \
2929
--security-opt apparmor=erichough-nfs \
3030
erichough/nfs-server
31+
32+
or in `docker-compose.yml`:
33+
34+
```YAML
35+
version: 3
36+
services:
37+
nfs:
38+
image: erichough/nfs-server
39+
volumes:
40+
- /path/to/share:/nfs
41+
- /path/to/exports.txt:/etc/exports:ro
42+
cap_add:
43+
- SYS_ADMIN
44+
ports:
45+
- 2049:2049
46+
security_opt:
47+
- apparmor=erichough-nfs
48+
```

0 commit comments

Comments
 (0)