/
githubmirror
/
code-server
Обзор
Документация
Войти
/
githubmirror
/
code-server
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v4.112.0
ci/release-image/entrypoint.sh
27 строк
978 B
xfl12345
Fix user rename when restarting container (#7012)
19 окт 2024, 01:57
Не верифицирован
19 окт 2024, 01:57
dd2e9fc
Код
Авторство
О чём код?
#!/bin/sh set -eu # We do this first to ensure sudo works below when renaming the user. # Otherwise the current container UID may not exist in the passwd database. eval "$(fixuid -q)" if [ "${DOCKER_USER-}" ]; then USER="$DOCKER_USER" if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null # Unfortunately we cannot change $HOME as we cannot move any bind mounts # nor can we bind mount $HOME into a new home as that requires a privileged container. sudo usermod --login "$DOCKER_USER" coder sudo groupmod -n "$DOCKER_USER" coder sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd fi fi # Allow users to have scripts run on container startup to prepare workspace. # https://github.com/coder/code-server/issues/5177 if [ -d "${ENTRYPOINTD}" ]; then find "${ENTRYPOINTD}" -type f -executable -print -exec {} \; fi exec dumb-init /usr/bin/code-server "$@"