更新 entrypoint.sh
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
mol
2024-02-25 05:46:21 +00:00
parent d16b5252d3
commit 9886f60b04

View File

@ -30,19 +30,14 @@ if [ "${DOCKER_USER-}" ]; then
fi
# git使用openssh的shh程序
git config --global core.sshCommand "/usr/bin/ssh"
su "$(id -un 1000)" -c 'git config --global core.sshCommand "/usr/bin/ssh"'
if [ -n "$GIT_USER" ] && [ -n "$GIT_EMAIL" ]; then
git config --global user.name "$GIT_USER"
git config --global user.email "$GIT_EMAIL"
su "$(id -un 1000)" -c 'git config --global user.name "$GIT_USER"'
su "$(id -un 1000)" -c 'git config --global user.email "$GIT_EMAIL"'
echo "git 用户已设置完毕"
fi
if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_PASSWD" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWD"
echo "docker 用户登录完成"
fi
sudo chown -R "$DOCKER_USER":999 /home/coder
# 移除无密码sudo
sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd
@ -63,5 +58,6 @@ ssh-agent bash
if [ -d "${ENTRYPOINTD}" ]; then
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
fi
su "$(id -un 1000)" -c "exec dumb-init /usr/bin/code-server $@"
RUN_CMD="exec dumb-init /usr/bin/code-server $@"
echo $RUN_CMD
su "$(id -un 1000)" -c $RUN_CMD