Codex CLI hard crashes on Alpine Container

Open 💬 1 comment Opened Feb 19, 2026 by seanmozeik

What version of Codex CLI is running?

0.104.0

What subscription do you have?

Pro

Which model were you using?

None, can't get in

What platform is your computer?

host is Darwin 25.3.0 arm64 arm, container is Linux 6.17.8-orbstack-00308-g8f9c941121b1 aarch64 unknown

What terminal emulator and version are you using (if applicable)?

Ghostty

What issue are you seeing?

On opening Codex (with --yolo), text renders vertically like this:

<img width="820" height="652" alt="Image" src="https://github.com/user-attachments/assets/3b813391-d8e8-4cd1-b00d-82727b89aa86" />

App appears to hang for 30s, then hard crashes:

The application panicked (crashed).
Message: byte index 18446462599985426017 is out of bounds of ``
Location: tui/src/wrapping.rs:20

Backtrace is empty.

What steps can reproduce the bug?

Provision a container (using Orb on mac):

FROM alpine:3.23 AS mise-tools
RUN apk add --no-cache mise bash curl xz build-base linux-headers zlib-dev \
    libffi-dev openssl-dev readline-dev bzip2-dev sqlite-dev xz-dev
ENV MISE_DATA_DIR=/opt/mise MISE_CONFIG_DIR=/opt/mise/config \
    RUSTUP_HOME=/opt/rustup CARGO_HOME=/opt/cargo XDG_DATA_HOME=/opt/mise
RUN mkdir -p /opt/mise /opt/rustup /opt/cargo
RUN mise use -g go
RUN mise use -g zig
RUN mise use -g rust
RUN mise use -g uv@latest
RUN mise use -g python@3.13

FROM alpine:3.23 AS bun-tools
RUN apk add --no-cache curl bash ca-certificates unzip libstdc++
ENV BUN_INSTALL=/usr/local/bun
ENV PATH="$BUN_INSTALL/bin:$PATH"
RUN curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local/bun bash
RUN bun install -g @openai/codex

FROM alpine:3.23 AS runtime

# System packages (node via apk, other runtimes from mise)
RUN apk add --no-cache \
    git curl wget jq zsh bash \
    build-base openssh-client \
    nodejs npm \
    github-cli mise \
    libstdc++ ncurses gcompat \
    coreutils findutils grep \
    zsh-autosuggestions zsh-syntax-highlighting

# Pre-installed tool paths (read-only from build stages)
ENV BUN_INSTALL=/usr/local/bun
ENV MISE_DATA_DIR=/opt/mise \
    MISE_CONFIG_DIR=/opt/mise/config

# Writable package manager homes for runtime installs
ENV CARGO_HOME=/home/yolo/.cargo \
    GOPATH=/home/yolo/go \
    UV_CACHE_DIR=/home/yolo/.cache/uv \
    UV_TOOL_BIN_DIR=/home/yolo/.local/bin \
    npm_config_prefix=/home/yolo/.local \
    npm_config_cache=/home/yolo/.cache/npm \
    PIP_CACHE_DIR=/home/yolo/.cache/pip \
    PATH="/home/yolo/.cargo/bin:/home/yolo/go/bin:/home/yolo/.local/bin:$BUN_INSTALL/bin:/opt/mise/shims:/opt/cargo/bin:${PATH}"

# Copy tool binaries
COPY --from=bun-tools /usr/local/bun /usr/local/bun
COPY --from=mise-tools /opt/mise /opt/mise
COPY --from=mise-tools /opt/rustup /opt/rustup
COPY --from=mise-tools /opt/cargo /opt/cargo

# Create non-root user
RUN addgroup -g 1000 yolo && adduser -u 1000 -G yolo -h /home/yolo -s /bin/zsh -D yolo
ENV HOME=/home/yolo

# Shell setup (auto-detect TERM support, prefer xterm-256color when unavailable)
RUN printf '%s\n' \
    'alias cc="claude --dangerously-skip-permissions"' \
    'alias co="codex --full-auto"' \
    >> /home/yolo/.zshrc \
    && printf '%s\n' \
    'alias cc="claude --dangerously-skip-permissions"' \
    'alias co="codex --yolo"' \
    >> /home/yolo/.bashrc

# Make global bun dir writable for runtime package installs
RUN chown -R yolo:yolo /usr/local/bun

# Prepare writable directories owned by yolo user
RUN mkdir -p /home/yolo/.claude /home/yolo/.codex \
    /home/yolo/.cargo/bin /home/yolo/go/bin \
    /home/yolo/.cache/uv /home/yolo/.cache/npm /home/yolo/.cache/pip \
    /home/yolo/.local/bin \
    && chown -R yolo:yolo /home/yolo

# Entrypoint
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

USER yolo
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["zsh"]

Entrypoint:

#!/bin/sh
set -e

# Copy Codex auth from host mount
if [ -f /host-codex/auth.json ]; then
  mkdir -p "$HOME/.codex"
  cp /host-codex/auth.json "$HOME/.codex/auth.json"
fi
cd /work
exec "$@"

Run codex, hard crashes as described.

What is the expected behavior?

It not to crash, or to be more verbose with the error and describe if there's dependencies missing.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗