Closed emidevops closed 1 year ago
I tried to give minimal permission to postgres using podman:
podman run --name mydatabase \ --uts=private --hostname mydatabase \ --pod mypod \ --pull missing --detach \ --cap-drop=all --read-only \ --mount "type=volume,src=mypgdata,dst=/var/lib/postgresql/data" \ --mount "type=volume,src=mypgrun,dst=/var/run/postgresql" \ -e "POSTGRES_DB=mydb" \ -e "POSTGRES_USER=mydba" \ -e "POSTGRES_PASSWORD=supersecret" \ -e "PGDATA=/var/lib/postgresql/data/pgdata" \ postgres:15.2-bullseye
It fail because of:
chown: changing ownership of '/var/lib/postgresql/data/pgdata': Operation not permitted
How can I avoid this chown behavior ?
If you run your container as non-root (--user), it will not try to chown (see the "Running as an arbitrary user" section of the image description on Docker Hub).
--user
chown
I tried to give minimal permission to postgres using podman:
It fail because of:
How can I avoid this chown behavior ?