From a9b916221cf6099566e545c5c4cb34d53ff35a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Sun, 9 Nov 2025 22:26:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(devcontainer):=20=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?Dockerfile=20=E5=92=8C=20devcontainer=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 DEVCONTAINER 和 SANDBOX 环境变量从 Dockerfile 移至 devcontainer.json, 以提升配置的灵活性和一致性。同时,更新注释内容以准确反映当前安装脚本的功能。 --- .devcontainer/Dockerfile | 5 +---- .devcontainer/devcontainer.json | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cda1c56..7e9cb20 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -15,9 +15,6 @@ ARG TZ=Asia/Shanghai ENV LANG=zh_CN.UTF-8 \ LC_ALL=zh_CN.UTF-8 \ TZ=${TZ} \ - # Set `DEVCONTAINER` environment variable to help with orientation - DEVCONTAINER=true \ - SANDBOX=sandbox-devcontainer \ # Set the default shell to zsh rather than sh SHELL=/bin/zsh \ # Set the default editor and visual @@ -91,7 +88,7 @@ RUN sh -c "$(curl -L -o - https://github.com/deluan/zsh-in-docker/releases/downl && echo "alias gemini='gemini --yolo -m gemini-2.5-pro'" >> /home/usr_vscode/.zshrc \ && echo "alias claude='claude --dangerously-skip-permissions'" >> /home/usr_vscode/.zshrc -# 安装 pnpm 和 Node.js +# 安装 pnpm # https://pnpm.io/installation#in-a-docker-container RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.zshrc" SHELL="$(which zsh)" zsh - \ && pnpm --version \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 54273e3..6407126 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -85,6 +85,8 @@ "GOOGLE_GEMINI_BASE_URL": "${localEnv:GOOGLE_GEMINI_BASE_URL}", "NODE_OPTIONS": "--max-old-space-size=4096", "CLAUDE_CONFIG_DIR": "/home/usr_vscode/.claude", + "DEVCONTAINER": "true", // https://github.com/anthropics/claude-code/blob/1fe9e369a7c30805189cbbb72eb69c15ed4ec96b/.devcontainer/Dockerfile#L42 + "SANDBOX": "sandbox-devcontainer", // gemini 显示这个。 "TZ": "${localEnv:TZ:Asia/Shanghai}" }, "remoteUser": "usr_vscode",