From 61e41c4de6e80d5c26dd3d6f11261d7724457b62 Mon Sep 17 00:00:00 2001 From: xinian Date: Sun, 29 Mar 2026 09:31:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=96=87=E4=BB=B6=20Dockerfi?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ide/Dockerfile | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/.ide/Dockerfile b/.ide/Dockerfile index e18f7fe06..f6128fe01 100644 --- a/.ide/Dockerfile +++ b/.ide/Dockerfile @@ -37,11 +37,40 @@ RUN go install -v golang.org/x/tools/gopls@latest && \ go install -v github.com/go-delve/delve/cmd/dlv@latest && \ go install github.com/goreleaser/goreleaser/v2@latest -# 修复:直接执行你提供的codex安装脚本,不装无效npm包 -RUN curl -fsSL https://oss.itbzzb.cn/setup-codex.sh | \ - YES=1 bash -s -- --base-url https://api.jucode.cn/v1 \ - --api-key sk-E0ZZIFNnD0RkhMC9pT2AGMutz9vNy2VLNrgyyobT5voa81pQ \ - --mirror auto +# 安装 Node.js 22(修复旧版node无法安装codex的问题) +RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ + apt update && \ + apt install -y nodejs && \ + npm config set registry https://registry.npmmirror.com/ && \ + npm install -g @openai/codex +# 配置 Codex +RUN mkdir -p /root/.codex + +# 写入 config.toml +RUN cat > /root/.codex/config.toml <<'EOF' +model_provider = "OpenAI" +model = "gpt-5.4" +model_reasoning_effort = "high" +disable_response_storage = true + +[model_providers.OpenAI] +name = "OpenAI" +base_url = "https://api.jucode.cn/v1" +wire_api = "responses" +requires_openai_auth = true +EOF + +# 写入 auth.json +RUN cat > /root/.codex/auth.json <<'EOF' +{ + "auth_mode": "apikey", + "OPENAI_API_KEY": "sk-E0ZZIFNnD0RkhMC9pT2AGMutz9vNy2VLNrgyyobT5voa81pQ" +} +EOF + +# 权限配置 +RUN chmod 600 /root/.codex/auth.json