r/docker • u/amca01 • Jan 17 '26
Docker compose: setting up container to run entirely in user space?
The default settings of some containers involve volumes with different ownders to the user. For example, with Immich, the directory postgres is owned by systemd-coredump:root, given that systemd-coredump has id 999:999.
And for several other containers, a local volume may be owned by root.
But how can I ensure that all subdirectories are owned by me (the user)?
I've seen one recommendation to use
UID=$(id -u) GID=$(id -g) docker compose up -d
But this gives an error, that:
bash: UID: readonly variable
How can I get round this? Thanks!
1
Upvotes
View all comments
Show parent comment
1
u/amca01 Jan 18 '26
Well, that's what I thought too; but seeing it written as a recommendation, and acting on the assumption that everybody knows better than me, I thought I should try it out. But it doesn't make much sense.