diff --git a/Dockerfile b/Dockerfile index 36cde81..4ecd9d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -163,10 +163,23 @@ RUN if [ "${INSTALL_GO}" = "true" ]; then \ # ── Optional: oh-my-opencode-slim (multi-agent orchestration) ──────── # Installs Bun runtime and the oh-my-opencode-slim npm package. # Runtime activation is controlled by ENABLE_OMOS env var in entrypoint. +# Uses the baseline Bun build (SSE4.2 only) for compatibility with older +# CPUs that lack AVX2 (e.g. Sandy Bridge on OpenStack). ARG INSTALL_OMOS=false ARG OMOS_VERSION=latest RUN if [ "${INSTALL_OMOS}" = "true" ]; then \ - curl -fsSL https://bun.sh/install | BUN_INSTALL=/usr/local bash && \ + ARCH=$(uname -m) && \ + if [ "$ARCH" = "x86_64" ]; then \ + BUN_ARCH="x64-baseline"; \ + elif [ "$ARCH" = "aarch64" ]; then \ + BUN_ARCH="aarch64"; \ + fi && \ + BUN_VERSION=$(curl -fsSL https://github.com/oven-sh/bun/releases/latest/download/LATEST) && \ + curl -fsSL "https://github.com/oven-sh/bun/releases/latest/download/bun-linux-${BUN_ARCH}.zip" -o /tmp/bun.zip && \ + unzip -o /tmp/bun.zip -d /tmp/bun && \ + mv /tmp/bun/bun-linux-${BUN_ARCH}/bun /usr/local/bin/bun && \ + chmod +x /usr/local/bin/bun && \ + rm -rf /tmp/bun /tmp/bun.zip && \ bun --version && \ npm install -g oh-my-opencode-slim@${OMOS_VERSION}; \ fi