Hello, I’m trying to pull a container in Cockpit using Podman and store its data on an mdraid. The mdraid was created successfully, but when I start the container and it begins to write data to the disk, nothing is created because it lacks permissions. I don’t know how to configure this: I’ve tried changing the user and granting read/write/execute permissions to everyone, but nothing works. The container is Dockge. This is what it returns:
2025-04-25T11:05:16Z [SERVER] INFO: Welcome to dockge!
2025-04-25T11:05:16Z [SERVER] INFO: NODE_ENV: production
2025-04-25T11:05:16Z [SERVER] INFO: Server Type: HTTP
2025-04-25T11:05:16Z [SERVER] INFO: Data Dir: ./data/
2025-04-25T11:05:16Z [DB] WARN: ENOENT: no such file or directory, open 'data/db-config.json'
2025-04-25T11:05:16Z [SERVER] ERROR: Failed to prepare your database: EACCES: permission denied, open 'data/db-config.json'
The man podman-run describes option --volume to apparently be a
shorthand for use of --mount=type=bind,...
Logically, the data is a subdirectory of the working directory, where you run the ‘podman run’.
I did not browse deeper to see if/how to create the file data/db-config.jsonbefore you run the container.
It does look like that the “/opt/stacks” is for the “store its data on” and you would either mount the filesystem on the mdraid as /opt/stacks on the host, or modify that in the compose.yaml.
SELinux might be preventing the writes by the container. If it is enabled, you need to make sure the folders are labeled with container_file_t. On the command line you can achieve it by adding :Z to your volume: podman run -d -v ./data:/app/data:Z --name mycontainer myimage. I guess it should work with compose as well. On the volume definition you can try something like this: