Improve Code Queue image build resilience

This commit is contained in:
Codex
2026-05-24 14:30:36 +00:00
parent 7cc60e9785
commit b3cbd12a57
@@ -7,7 +7,7 @@ ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:${PATH}
RUN (command -v codex >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 && command -v docker >/dev/null 2>&1 && docker buildx version >/dev/null 2>&1 && command -v gh >/dev/null 2>&1 && command -v rg >/dev/null 2>&1 && command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1 && command -v rustfmt >/dev/null 2>&1 && command -v xvfb-run >/dev/null 2>&1 && test -x "$PLAYWRIGHT_BROWSERS_PATH/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell") \
RUN (command -v docker >/dev/null 2>&1 && docker buildx version >/dev/null 2>&1 && command -v gh >/dev/null 2>&1 && command -v rg >/dev/null 2>&1 && command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1 && command -v rustfmt >/dev/null 2>&1 && command -v xvfb-run >/dev/null 2>&1) \
|| (apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
@@ -49,11 +49,19 @@ RUN (command -v codex >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 &&
&& mkdir -p /usr/local/lib/docker/cli-plugins /root/.docker/cli-plugins \
&& ln -sf /usr/bin/docker-compose /usr/local/lib/docker/cli-plugins/docker-compose \
&& ln -sf /usr/bin/docker-compose /root/.docker/cli-plugins/docker-compose \
&& npm install -g @openai/codex@0.128.0 opencode-ai@1.14.48 playwright@1.59.1 \
&& playwright install --with-deps chromium \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*)
RUN (command -v codex >/dev/null 2>&1 && command -v opencode >/dev/null 2>&1 && command -v playwright >/dev/null 2>&1) \
|| (npm config set fetch-retries 5 \
&& npm config set fetch-retry-factor 2 \
&& npm config set fetch-retry-mintimeout 20000 \
&& npm config set fetch-retry-maxtimeout 120000 \
&& for attempt in 1 2 3 4 5; do npm install -g @openai/codex@0.128.0 opencode-ai@1.14.48 playwright@1.59.1 && break; if [ "$attempt" = "5" ]; then exit 1; fi; echo "npm_global_retry=$attempt" >&2; sleep $((attempt * 20)); done)
RUN test -x "$PLAYWRIGHT_BROWSERS_PATH/chromium_headless_shell-1217/chrome-headless-shell-linux64/chrome-headless-shell" \
|| for attempt in 1 2 3; do playwright install --with-deps chromium && break; if [ "$attempt" = "3" ]; then exit 1; fi; echo "playwright_install_retry=$attempt" >&2; sleep $((attempt * 30)); done
RUN command -v xauth >/dev/null 2>&1 \
|| (apt-get update \
&& apt-get install -y --no-install-recommends xauth \