Skip to content

Commit 60487cb

Browse files
authored
Update Dockerfile
1 parent 009d3fc commit 60487cb

1 file changed

Lines changed: 3 additions & 28 deletions

File tree

Dockerfile

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -104,34 +104,9 @@ RUN \
104104

105105
# --- Git Configuration Script ---
106106
# 创建 Git 配置脚本
107-
RUN cat > /usr/local/bin/setup-git.sh << 'EOF'
108-
#!/bin/bash
109-
110-
# 获取环境变量,如果未设置则使用默认值
111-
GIT_EMAIL="${GIT_USER_EMAIL:-code-server@fjy8018.top}"
112-
GIT_NAME="${GIT_USER_NAME:-fjy8018}"
113-
114-
echo "Configuring Git with:"
115-
echo " Email: $GIT_EMAIL"
116-
echo " Name: $GIT_NAME"
117-
118-
# 配置全局 Git 设置
119-
git config --global user.email "$GIT_EMAIL"
120-
git config --global user.name "$GIT_NAME"
121-
122-
# 设置一些有用的 Git 默认配置
123-
git config --global init.defaultBranch main
124-
git config --global pull.rebase false
125-
git config --global core.autocrlf input
126-
git config --global core.editor "code-server --wait"
127-
128-
echo "Git configuration completed!"
129-
git config --global --list | grep -E "(user\.|init\.|pull\.|core\.)"
130-
EOF
131-
132-
# 使脚本可执行
133-
RUN chmod +x /usr/local/bin/setup-git.sh
134-
107+
RUN git config --global user.email "$GIT_EMAIL" \
108+
&& git config --global user.name "$GIT_NAME"
109+
135110
# --- User Configuration Phase (as coder) ---
136111
USER coder
137112

0 commit comments

Comments
 (0)