Comments (7)
Checked again -- atm. PostgreSQL processes are run as 'postgres:postgres', you you somehow have to set the permissions so the process can write to data directory. Other option is to change the user by docker run -u
and set the directory ownership accordignly. Btw., soon we could (in #208) add the 'postgres' user into 'root' group...
from postgresql-container.
[root@client ~]# setfacl -m u:26:-wx /srv/db2/cccp/
The benefit of setfacl
is primarily that you don't have to be root to allow containerized app to write there. The drawback is that it doesn't work for everybody, hm. Do you have spelling ideas for the documentation?
Note: Changing NFS server config to have uid=26 works for postgresql container, however, how does one manage UID/GID consistency all over the place then?
All over the place == all containers? You can make the directory world-writeable, or group '0' writeable (I think by default the processes are run under group 0). I'm not convinced this is a good recommendable default, though.
from postgresql-container.
Do you have spelling ideas for the documentation?
as in if documentation can be updated with a better explanation?
from postgresql-container.
I'm not convinced this is a good recommendable default, though.
@praiskup
Yes, any idea what could be a better solution if one wants to have NFS share mounted as data directory for postgresql?
from postgresql-container.
soon we could (in #208) add the 'postgres' user into 'root' group...
@praiskup : I have been keeping an eye on PR #208. IIUC the outcome should be seamlessly attaching host machine volume to /var/lib/pgsql/data
directory inside the container. However, it seems to fail with permission issues again. Am I missing something here?
# docker images registry.centos.org/centos/postgresql-95-centos7
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.centos.org/centos/postgresql-95-centos7 latest 0785e3c7337e About an hour ago 335 MB
# mkdir /tmp/foo
# docker run -d --name=vol-test -e POSTGRESQL_USER=cccp -e POSTGRESQL_PASSWORD=cccp -e POSTGRESQL_DATABASE=cccp -v /tmp/foo:/var/lib/pgsql/data:Z registry.centos.org/centos/postgresql-95-centos7
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# docker logs -f vol-test
mkdir: cannot create directory '/var/lib/pgsql/data/userdata': Permission denied
# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
# rpm -q docker
docker-1.12.6-61.git85d7426.el7.centos.x86_64
Results are same with and without providing :Z
options to volume option in docker run command.
from postgresql-container.
@navidshaikh have you added proper group ownership to /tmp/foo? (sudo chgrp root /tmp/foo
)
from postgresql-container.
have you added proper group ownership to /tmp/foo? (sudo chgrp root /tmp/foo)
# ls -la /tmp/foo/
total 0
drwxr-xr-x. 2 root root 6 Jan 10 15:08 .
drwxrwxrwt. 12 root root 250 Jan 11 03:25 ..
from postgresql-container.
Related Issues (20)
- Error when starting CentOS images in podman HOT 2
- uname -i/-p not working on Fedora any more
- No Action Required !! Testing automation workflow HOT 1
- Move off Fedora 35 parent images HOT 1
- PostgreSQL 14 support - question HOT 5
- Add option to log lines in JSON HOT 1
- Remove `run_master_restart_test` tests HOT 5
- How to tune memory when running image in OpenShift HOT 1
- Write permission issue on /var/lib/pgsql/data HOT 2
- Test `run_logging_test` is failing HOT 2
- Cannot run container as non-root user
- avc: denied raised during the `run_change_password_test` HOT 3
- Testsuite seems to be passing, even though a specific tests fails. HOT 1
- postgres constantly restarted inside container HOT 1
- run_change_password_test() does not test password change HOT 1
- Upgrade fails due to postmaster.pid HOT 29
- latest tag missing from postgresql-12-centos7 HOT 3
- postgres password appears in process table HOT 1
- Testing requires additional software HOT 3
- Deprecate old Fedora postgresql version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgresql-container.