I am trying to improve and generalize my develop setup with Dev Containers + Podman + Test Containers. I am running into some permission issues though. Specifically, running test container tests in a simple example I get a permissions error in the container. It does create the container successfully, but podman logs ... shows error:
chmod: /var/lib/postgresql/data: Operation not permitted
chmod: /var/run/postgresql: Operation not permitted
The files belonging to this database system will be owned by user "crosleyzack".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
fixing permissions on existing directory /var/lib/postgresql/data ... %
This example worked without dev containers, but dev containers supposedly inherits your user UID and GID, so the permissions errors are strange. I have tried explicitly setting userns and privileged with no success.
The output of podman inspect shows:
"IDMappings": {
"UidMap": [
"0:1:1000",
"1000:0:1",
"1001:1001:64536"
],
"GidMap": [
"0:1:1000",
"1000:0:1",
"1001:1001:64536"
]
},
which looks like the route issue