added note about selinux and mountpoints

This commit is contained in:
Sameer Naik
2014-09-02 11:19:50 +05:30
parent 5023375538
commit a37704e05e
+9 -1
View File
@@ -96,8 +96,16 @@ psql -U postgres -h $(docker inspect --format {{.NetworkSettings.IPAddress}} pos
For data persistence a volume should be mounted at `/var/lib/postgresql`.
SELinux users are also required to change the security context of the mount point so that it plays nicely with selinux.
```bash
mkdir -p /opt/postgresql/data
sudo chcon -Rt svirt_sandbox_file_t /opt/postgresql/data
```
The updated run command looks like this.
```bash
mkdir /opt/postgresql/data
docker run --name postgresql -d \
-v /opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql:latest
```