fix(Dockerfile): 確保安裝腳本失敗時清理暫存檔

This commit is contained in:
2026-06-24 13:19:37 +00:00
parent a5308acf88
commit c88b2a8c61
+2 -2
View File
@@ -13,13 +13,13 @@ RUN apk add --no-cache --no-check-certificate bash ca-certificates curl git jq u
# 安裝 Codex CLI 工具 # 安裝 Codex CLI 工具
RUN install_script="$(mktemp)" \ RUN install_script="$(mktemp)" \
&& trap 'rm -f "$install_script"' EXIT \
&& curl -fsSL --retry 3 --retry-delay 2 --max-time 120 \ && curl -fsSL --retry 3 --retry-delay 2 --max-time 120 \
https://chatgpt.com/codex/install.sh \ https://chatgpt.com/codex/install.sh \
-o "$install_script" \ -o "$install_script" \
&& echo "${CODEX_INSTALL_SHA256} ${install_script}" | sha256sum -c - \ && echo "${CODEX_INSTALL_SHA256} ${install_script}" | sha256sum -c - \
&& sh "$install_script" \ && sh "$install_script" \
&& codex --version \ && codex --version
&& rm -f "$install_script"
# 安裝技能 # 安裝技能
RUN codex plugin marketplace add "https://gitea.jsc.idv.tw/plugins/doc.git" --ref "$CODEX_DOC_MARKETPLACE_REF" \ RUN codex plugin marketplace add "https://gitea.jsc.idv.tw/plugins/doc.git" --ref "$CODEX_DOC_MARKETPLACE_REF" \