docker icon indicating copy to clipboard operation
docker copied to clipboard

Run docker container as non-root user

Open kidwellj opened this issue 3 years ago • 2 comments

It's my understanding that running docker containers as root isn't ideal. The current configuration, which runs internally as www-data and externally as root can create some problems with access to permissions on the /music folder, and it's rather difficult to change the user after the container has been created, so this can't be sorted by simply adding a docker compose line user: $UID:$GID as subsequent access to the contents of the container by www-data (or whatever) is broken. It seems to me that it would be relatively trivial to map www-data onto a custom UID which could then, by extension, map onto a user account on the host OS. Has there been discussion on this before and perhaps some options ruled out? I'm happy to add a pull-request, but am aware there are several was to do it.

kidwellj avatar Aug 28 '22 07:08 kidwellj

I admittedly am no Docker expert, so feel free to send a PR over if you think this is something that can use some improvements :)

phanan avatar Aug 30 '22 14:08 phanan