coder / envbuilder

Build development environments from a Dockerfile on Docker, Kubernetes, and OpenShift. Enable developers to modify their development environment quickly.
Apache License 2.0
142 stars 26 forks source link

fix: update ownership of user homedir #238

Closed johnstcn closed 3 months ago

johnstcn commented 3 months ago

Fixes https://github.com/coder/envbuilder/issues/229

If a user mounts a Docker volume into /home/$USER, Docker will automatically assign permissions root:root to it as the envbuilder container runs as root by default. The resulting container will then have /home/$USER owned by root:root. The user will be unable to write any files there until they manually fix the permissions, which would require root privileges.

This PR adds a step to fix ownership of /home/$USER to the uid:gid we get from UserInfo.