I’ve been playing around with some more advanced Dockerised setups with Rancher today and have stumbled across a small issue. It’s not a dealbreaker, and I don’t think it’s a problem with Rancher, but rather, a configuration issue somewhere along the way while setting Rancher up.
Basically, when creating a container and mounting a volume, if the folder on the host doesn’t exist, it gets created as root (I’m assuming that’s because that’s the user that docker is running as on the host? This is the problem though, I don’t know what to change to make it work how I want). I want this to be owned by my user on my server, with the UID and GID of 1000, otherwise, I have to chown the folder for the containers to initialise properly because they can’t write into the volume folders otherwise.
What do I need to change to make the folders be created as my user, or am I simply stuck having to chown them?