fix(Codex CLI): 強化認證驗證與安全執行

This commit is contained in:
2026-06-24 10:33:18 +00:00
parent 571e3693da
commit 690bf98565
3 changed files with 32 additions and 12 deletions
+10 -7
View File
@@ -1,7 +1,7 @@
FROM alpine:latest
# 安裝必要的工具
RUN apk add --no-cache --no-check-certificate bash ca-certificates curl git
RUN apk add --no-cache --no-check-certificate bash ca-certificates curl git jq
# 設定安裝用的環境變數
ENV CODEX_NON_INTERACTIVE=1
@@ -9,14 +9,17 @@ ENV CODEX_INSTALL_DIR=/usr/local/bin
ENV CODEX_HOME=/root/.codex
# 安裝 Codex CLI 工具
RUN curl -fsSL https://chatgpt.com/codex/install.sh | sh
RUN install_script="$(mktemp)" \
&& curl -fsSL --retry 3 --retry-delay 2 --max-time 120 \
https://chatgpt.com/codex/install.sh \
-o "$install_script" \
&& sh "$install_script" \
&& rm -f "$install_script"
# 安裝 doc 技能
# 安裝技能
RUN codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/doc.git \
&& codex plugin add jsc@doc
# 安裝 code-review 技能
RUN codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/code-review.git \
&& codex plugin add jsc@doc \
&& codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/code-review.git \
&& codex plugin add jsc@code-review
COPY entrypoint.sh /entrypoint.sh