From 2a2e0ce4ce477eb8e8d421c0443d1b6cde4ea7e2 Mon Sep 17 00:00:00 2001 From: mol Date: Sun, 25 Feb 2024 07:42:26 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20entrypoint.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index faab1bb..e394e8c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,6 +17,7 @@ if [ "${DOCKER_USER-}" ]; then # 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 chown -R "$DOCKER_USER":999 /home/coder sudo usermod --login "$DOCKER_USER" "$USER_HOME" sudo groupmod -n "$DOCKER_USER" "$USER_HOME" #sudo printf "user: $DOCKER_USER\ngroup: $DOCKER_USER\n" > /etc/fixuid/config.yml @@ -26,6 +27,7 @@ if [ "${DOCKER_USER-}" ]; then echo "git配置文件已存在" else touch /home/coder/.gitconfig + chown -R "$DOCKER_USER":999 /home/coder/.gitconfig echo "git配置文件已创建" fi @@ -38,7 +40,6 @@ if [ "${DOCKER_USER-}" ]; then echo "git 用户已设置完毕" fi - sudo chown -R "$DOCKER_USER":999 /home/coder # 移除无密码sudo sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd fi