diff --git a/.ide/Dockerfile b/.ide/Dockerfile index f0fd44276..c46f0a2cb 100644 --- a/.ide/Dockerfile +++ b/.ide/Dockerfile @@ -16,7 +16,7 @@ ENV GOCACHE=/workspace/.cache/go-build ENV GOMODCACHE=/workspace/.cache/gomod # ========================================== -# 2. Codex 配置 (需要更换时,直接修改这里,重新 build 即可) +# 2. Codex 配置 (更换时修改这里,重新 build) # ========================================== ENV CODEX_BASE_URL="https://api.aibh.site/v1" ENV CODEX_MODEL="gpt-5.4" @@ -30,63 +30,60 @@ RUN set -ex; \ apt install -y --no-install-recommends \ wget rsync unzip openssh-server vim lsof git git-lfs \ locales libgit2-1.5 libgit2-dev net-tools jq curl ca-certificates sudo gnupg lsb-release xz-utils && \ - # 安装 Golang \ curl -fsSLO "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" && \ rm -rf /usr/local/go && tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz" && \ rm -f "go${GO_VERSION}.linux-amd64.tar.gz" && \ - # 安装 golangci-lint \ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2 && \ - # 安装 code-server \ curl -fsSL https://code-server.dev/install.sh | sh && \ - # 清理缓存 \ apt clean && rm -rf /var/lib/apt/lists/* # ========================================== -# 4. [国内加速] 安装 Node.js 与 Codex (直接用淘宝源下载二进制包,防卡死) +# 4. 安装工具链 (国内加速版) # ========================================== RUN set -ex; \ - # 安装 Go 工具链 \ go install -v golang.org/x/tools/gopls@latest && \ go install -v github.com/cweill/gotests/gotests@latest && \ go install -v github.com/josharian/impl@latest && \ go install -v github.com/haya14busa/goplay/cmd/goplay@latest && \ go install -v github.com/go-delve/delve/cmd/dlv@latest && \ go install github.com/goreleaser/goreleaser/v2@latest && \ - # 从淘宝镜像直接下载 Node.js 22 预编译包 (彻底绕过 nodesource 恶心网络) \ - NODE_VER="v22.11.0" && \ - wget -q "https://npmmirror.com/mirrors/node/${NODE_VER}/node-${NODE_VER}-linux-x64.tar.xz" -O /tmp/node.tar.xz && \ + wget -q "https://npmmirror.com/mirrors/node/v22.11.0/node-v22.11.0-linux-x64.tar.xz" -O /tmp/node.tar.xz && \ tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 && \ rm -f /tmp/node.tar.xz && \ - # 强制锁定 npm 为淘宝源 \ npm config set registry https://registry.npmmirror.com/ && \ - # 安装 Codex CLI \ - npm install -g @openai/codex && \ - # 生成 Codex 配置文件 \ - mkdir -p /root/.codex && \ - cat > /root/.codex/config.toml < /root/.codex/config.toml < /root/.codex/auth.json < /root/.codex/auth.json <> /root/.bashrc && \ echo "export CODEX_API_KEY=\"${OPENAI_API_KEY}\"" >> /root/.bashrc # ========================================== -# 5. 安装 code-server 插件 +# 6. 安装 code-server 插件 # ========================================== RUN set -eux; \ USER_DATA_DIR=/var/lib/code-server; \ @@ -117,7 +114,7 @@ RUN set -eux; \ [ -z "${FAILED_EXTENSIONS}" ] && echo "所有插件安装完成 ✅" || echo "以下插件安装失败:${FAILED_EXTENSIONS}" # ========================================== -# 6. 统一缓存目录 & 环境变量 +# 7. 统一缓存目录 & 环境变量 # ========================================== RUN mkdir -p /workspace/.cache/go-build /workspace/.cache/gomod /workspace/.cache/goimports && \ chmod -R a+rwx /workspace/.cache && \