Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/lib/src/core/templates/dockerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@ const renderDockerfileBunPrelude = (config: TemplateConfig): string =>
`# Tooling: pnpm + Codex CLI + oh-my-opencode (bun) + Claude Code CLI (npm)
RUN corepack enable && corepack prepare pnpm@${config.pnpmVersion} --activate
ENV TERM=xterm-256color
RUN curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local/bun bash
RUN set -eu; \
for attempt in 1 2 3 4 5; do \
if curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 https://bun.sh/install -o /tmp/bun-install.sh \
&& BUN_INSTALL=/usr/local/bun bash /tmp/bun-install.sh; then \
rm -f /tmp/bun-install.sh; \
exit 0; \
fi; \
echo "bun install attempt \${attempt} failed; retrying..." >&2; \
rm -f /tmp/bun-install.sh; \
sleep $((attempt * 2)); \
done; \
echo "bun install failed after retries" >&2; \
exit 1
RUN ln -sf /usr/local/bun/bin/bun /usr/local/bin/bun
RUN BUN_INSTALL=/usr/local/bun script -q -e -c "bun add -g @openai/codex@latest oh-my-opencode@latest" /dev/null
RUN ln -sf /usr/local/bun/bin/codex /usr/local/bin/codex
Expand Down
14 changes: 13 additions & 1 deletion packages/lib/src/usecases/auth-codex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,19 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*
ENV BUN_INSTALL=/usr/local/bun
ENV PATH="/usr/local/bun/bin:$PATH"
RUN curl -fsSL https://bun.sh/install | bash
RUN set -eu; \
for attempt in 1 2 3 4 5; do \
if curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 https://bun.sh/install -o /tmp/bun-install.sh \
&& BUN_INSTALL=/usr/local/bun bash /tmp/bun-install.sh; then \
rm -f /tmp/bun-install.sh; \
exit 0; \
fi; \
echo "bun install attempt \${attempt} failed; retrying..." >&2; \
rm -f /tmp/bun-install.sh; \
sleep $((attempt * 2)); \
done; \
echo "bun install failed after retries" >&2; \
exit 1
RUN ln -sf /usr/local/bun/bin/bun /usr/local/bin/bun
RUN script -q -e -c "bun add -g @openai/codex@latest" /dev/null
RUN ln -sf /usr/local/bun/bin/codex /usr/local/bin/codex
Expand Down
4 changes: 4 additions & 0 deletions packages/lib/tests/usecases/prepare-files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ describe("prepareProjectFiles", () => {
const composeBefore = yield* _(fs.readFileString(path.join(outDir, "docker-compose.yml")))
expect(dockerfile).toContain("docker-compose-v2")
expect(dockerfile).toContain("gitleaks version")
expect(dockerfile).toContain(
"curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 https://bun.sh/install -o /tmp/bun-install.sh"
)
expect(dockerfile).toContain("bun install attempt ${attempt} failed; retrying...")
expect(entrypoint).toContain('DOCKER_GIT_HOME="/home/dev/.docker-git"')
expect(entrypoint).toContain('SOURCE_SHARED_AUTH="/home/dev/.codex-shared/auth.json"')
expect(entrypoint).toContain('CODEX_LABEL_RAW="$CODEX_AUTH_LABEL"')
Expand Down