spawn/sh/docker/openclaw.Dockerfile
A 05492f5a88
fix: pin bun install to v1.3.9 in all agent scripts (#2345)
Agent: security-auditor

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-08 12:47:18 -04:00

32 lines
1 KiB
Docker

FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Base packages
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
curl git ca-certificates build-essential unzip xz-utils zsh && \
rm -rf /var/lib/apt/lists/*
# Node.js 22 via apt + n
RUN apt-get update -y && \
apt-get install -y --no-install-recommends nodejs npm && \
npm install -g n && n 22 && \
ln -sf /usr/local/bin/node /usr/bin/node && \
ln -sf /usr/local/bin/npm /usr/bin/npm && \
ln -sf /usr/local/bin/npx /usr/bin/npx && \
rm -rf /var/lib/apt/lists/*
# Bun
RUN curl -fsSL --proto '=https' https://bun.sh/install?version=1.3.9 | bash
ENV PATH="/root/.bun/bin:/root/.local/bin:${PATH}"
# OpenClaw via npm (Node runtime needs standard node_modules layout)
RUN npm install -g openclaw
# Ensure tools are on PATH for all shells
RUN for rc in /root/.bashrc /root/.zshrc; do \
grep -q '.bun/bin' "$rc" 2>/dev/null || \
echo 'export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH"' >> "$rc"; \
done
CMD ["/bin/sleep", "inf"]