docker-postgresql
docker-postgresql copied to clipboard
sudoers: Permission denied
I got this error when I run the container (any version: latest, 9:6, ...).
OS: Debian 9.6 Kernel: 4.9.0-8-amd64
/var/lib/docker is a mount point (partition of 92GB only with that)
Initializing datadir...
Initializing certdir...
Initializing logdir...
Initializing rundir...
Setting resolv.conf ACLs...
Initializing database...
sudo: unable to stat /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
In other server with same OS is working OK.
This is not a system problem, it is a container security context issue.
Fix:
docker/podman --cap-add audit_write ....
fix for kubernetes:
deployment/statefulset etc:
...
containers:
- name: postgresql
image: sameersbn/postgresql:latest
securityContext:
capabilities:
add: ["AUDIT_WRITE"]
....
thx help