File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed
Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,19 @@ const renderDockerfileBunPrelude = (config: TemplateConfig): string =>
3434 `# Tooling: pnpm + Codex CLI + oh-my-opencode (bun) + Claude Code CLI (npm)
3535RUN corepack enable && corepack prepare pnpm@${ config . pnpmVersion } --activate
3636ENV TERM=xterm-256color
37- RUN curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local/bun bash
37+ RUN set -eu; \
38+ for attempt in 1 2 3 4 5; do \
39+ if curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 https://bun.sh/install -o /tmp/bun-install.sh \
40+ && BUN_INSTALL=/usr/local/bun bash /tmp/bun-install.sh; then \
41+ rm -f /tmp/bun-install.sh; \
42+ exit 0; \
43+ fi; \
44+ echo "bun install attempt \${attempt} failed; retrying..." >&2; \
45+ rm -f /tmp/bun-install.sh; \
46+ sleep $((attempt * 2)); \
47+ done; \
48+ echo "bun install failed after retries" >&2; \
49+ exit 1
3850RUN ln -sf /usr/local/bun/bin/bun /usr/local/bin/bun
3951RUN BUN_INSTALL=/usr/local/bun script -q -e -c "bun add -g @openai/codex@latest oh-my-opencode@latest" /dev/null
4052RUN ln -sf /usr/local/bun/bin/codex /usr/local/bin/codex
Original file line number Diff line number Diff line change @@ -47,7 +47,19 @@ RUN apt-get update \
4747 && rm -rf /var/lib/apt/lists/*
4848ENV BUN_INSTALL=/usr/local/bun
4949ENV PATH="/usr/local/bun/bin:$PATH"
50- RUN curl -fsSL https://bun.sh/install | bash
50+ RUN set -eu; \
51+ for attempt in 1 2 3 4 5; do \
52+ if curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 https://bun.sh/install -o /tmp/bun-install.sh \
53+ && BUN_INSTALL=/usr/local/bun bash /tmp/bun-install.sh; then \
54+ rm -f /tmp/bun-install.sh; \
55+ exit 0; \
56+ fi; \
57+ echo "bun install attempt \${attempt} failed; retrying..." >&2; \
58+ rm -f /tmp/bun-install.sh; \
59+ sleep $((attempt * 2)); \
60+ done; \
61+ echo "bun install failed after retries" >&2; \
62+ exit 1
5163RUN ln -sf /usr/local/bun/bin/bun /usr/local/bin/bun
5264RUN script -q -e -c "bun add -g @openai/codex@latest" /dev/null
5365RUN ln -sf /usr/local/bun/bin/codex /usr/local/bin/codex
Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ describe("prepareProjectFiles", () => {
117117 const composeBefore = yield * _ ( fs . readFileString ( path . join ( outDir , "docker-compose.yml" ) ) )
118118 expect ( dockerfile ) . toContain ( "docker-compose-v2" )
119119 expect ( dockerfile ) . toContain ( "gitleaks version" )
120+ expect ( dockerfile ) . toContain (
121+ "curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 https://bun.sh/install -o /tmp/bun-install.sh"
122+ )
123+ expect ( dockerfile ) . toContain ( "bun install attempt ${attempt} failed; retrying..." )
120124 expect ( entrypoint ) . toContain ( 'DOCKER_GIT_HOME="/home/dev/.docker-git"' )
121125 expect ( entrypoint ) . toContain ( 'SOURCE_SHARED_AUTH="/home/dev/.codex-shared/auth.json"' )
122126 expect ( entrypoint ) . toContain ( 'CODEX_LABEL_RAW="$CODEX_AUTH_LABEL"' )
You can’t perform that action at this time.
0 commit comments