docker-postgresql icon indicating copy to clipboard operation
docker-postgresql copied to clipboard

sudoers: Permission denied

Open SRJ9 opened this issue 6 years ago • 2 comments

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.

SRJ9 avatar Jan 10 '19 22:01 SRJ9

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"]
....

YouSysAdmin avatar Dec 29 '20 22:12 YouSysAdmin

thx help

mikeqoo1 avatar Mar 09 '22 01:03 mikeqoo1