mirror of
https://github.com/coder/code-server.git
synced 2024-12-18 15:11:35 +03:00
3df771fbc4
* Check the logged user instead of $USER Given that `sudo usermod --login "$DOCKER_USER" coder` and `sudo groupmod -n "$DOCKER_USER" coder` modify the container's disk it'll persist across restarts, but environment variables will be reset to whatever state they had at the end of `Dockerfile`. In this case, `$USER` is set to `coder`, so this branch will always be true. By checking with the output of `whoami`, which gets it's information from `/etc/passwd`, we make sure to get the real logged user and not the one defined by $USER. We also move `USER="$DOCKER_USER"` out of the branch, since we always want this to happen at entry-point. If we don't do this assignment, $USER will contain `coder` upon restart. * Update entrypoint.sh Check `$DOCKER_USER` was defined before copying it to `$USER`. |
||
---|---|---|
.. | ||
build.sh | ||
Dockerfile | ||
entrypoint.sh |