From a37704e05e3089dc2245fd178e7a58dcbd0bd6b7 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Tue, 2 Sep 2014 11:19:50 +0530 Subject: [PATCH] added note about selinux and mountpoints --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f4d4cd2..a12a4c5 100644 --- a/README.md +++ b/README.md @@ -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 ```