Use Bun baseline build for AVX2-less CPU compatibility (Sandy Bridge)
This commit is contained in:
+14
-1
@@ -163,10 +163,23 @@ RUN if [ "${INSTALL_GO}" = "true" ]; then \
|
|||||||
# ── Optional: oh-my-opencode-slim (multi-agent orchestration) ────────
|
# ── Optional: oh-my-opencode-slim (multi-agent orchestration) ────────
|
||||||
# Installs Bun runtime and the oh-my-opencode-slim npm package.
|
# Installs Bun runtime and the oh-my-opencode-slim npm package.
|
||||||
# Runtime activation is controlled by ENABLE_OMOS env var in entrypoint.
|
# 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 INSTALL_OMOS=false
|
||||||
ARG OMOS_VERSION=latest
|
ARG OMOS_VERSION=latest
|
||||||
RUN if [ "${INSTALL_OMOS}" = "true" ]; then \
|
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 && \
|
bun --version && \
|
||||||
npm install -g oh-my-opencode-slim@${OMOS_VERSION}; \
|
npm install -g oh-my-opencode-slim@${OMOS_VERSION}; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user