mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-08-08 11:18:34 +08:00
added note about selinux and mountpoints
This commit is contained in:
@@ -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`.
|
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
|
```bash
|
||||||
mkdir /opt/postgresql/data
|
|
||||||
docker run --name postgresql -d \
|
docker run --name postgresql -d \
|
||||||
-v /opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql:latest
|
-v /opt/postgresql/data:/var/lib/postgresql sameersbn/postgresql:latest
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user