Due to certain reasons, I have discovered that the users storing files are www-data users and www-data groups. I would like to modify the storage user’s ID to complete certain tasks.
thank you !
from sam123
if i’m understanding the postings in the thread linked above correctly it is currently not possible to choose a different ID number “out of the box” in the ownCloud docker containers. If i understand it correctly either www-data is used or no IDs are getting changed.
You can do that with Podman using its usernamespaces feature, but Docker doesn’t seem to implement that feature by default Isolate containers with a user namespace | Docker Docs. It’s one of the many architectural differences behind my reasoning for switching to Podman. I believe that all of these add up to make Podman more a secure platform that works with a typical Linux stack instead of on top of the OS as like a frankensteined piece of software.
To modify the file owner and group of the storage directory in your docker-compose.yml, you’ll need to adjust the Docker container’s user permissions. You can do this by using Docker’s user directive to specify the user and group IDs that the container should run as.
For example, you can update the owncloud service in your docker-compose.yml like this:
yaml
Copy code
services:
owncloud:
image: owncloud/server
container_name: owncloud_server
restart: always
ports:
- 8102:8080
depends_on:
- mariadb
- redis
environment:
# ... your existing environment variables
healthcheck:
# ... your existing healthcheck
volumes:
- files:/mnt/data
user: "1001:1001" # Replace with your desired user and group IDs
Make sure to replace 1001:1001 with the actual user and group IDs you need. This will ensure that the container runs with the specified user and group permissions, allowing you to adjust file ownership as required.