mirror of
https://github.com/joelhooks/joelclaw.git
synced 2026-09-19 01:24:04 +08:00
957929e510
Story 1+2 from Firecracker PRD. Adds: - guest-runner.sh: poll loop inside Firecracker VM that watches .joelclaw-microvm/run.signal, executes command.sh, writes result.json - Dockerfile.rootfs: COPY guest-runner into image - build-rootfs.sh inittab: respawn guest-runner + debug shell on ttyS0 Protocol: host writes command+signal → guest executes → writes result → host polls. No bashisms — POSIX sh compatible with busybox. Handles timeout via request.json timeoutMs field. Auto-restarts via busybox init respawn.
55 lines
1.3 KiB
Docker
55 lines
1.3 KiB
Docker
# Firecracker agent rootfs — Alpine-based aarch64 userspace with agent tooling
|
|
#
|
|
# NOT run as a container. Exported as filesystem → ext4 image for Firecracker.
|
|
|
|
FROM alpine:3.20
|
|
|
|
ENV HOME=/root
|
|
ENV PATH="/root/.bun/bin:/usr/local/bin:$PATH"
|
|
|
|
# Base system
|
|
RUN apk add --no-cache \
|
|
bash \
|
|
ca-certificates \
|
|
curl \
|
|
git \
|
|
openssh-client \
|
|
sudo \
|
|
jq \
|
|
wget \
|
|
unzip \
|
|
# Build tools for native modules
|
|
build-base \
|
|
python3 \
|
|
linux-headers \
|
|
# Init (busybox provides /sbin/init natively in Alpine) \
|
|
# Networking
|
|
iptables \
|
|
iproute2 \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
# Install bun (Alpine-compatible)
|
|
RUN curl -fsSL https://bun.sh/install | bash
|
|
|
|
# Install Node.js via Alpine package (simpler than fnm in Alpine)
|
|
RUN apk add --no-cache nodejs npm
|
|
|
|
# Verify tools
|
|
RUN echo "=== Tool verification ===" && \
|
|
bun --version && \
|
|
node --version && \
|
|
npm --version && \
|
|
git --version && \
|
|
python3 --version && \
|
|
echo "=== All tools verified ==="
|
|
|
|
# Create workspace and artifacts directories
|
|
RUN mkdir -p /workspace /artifacts
|
|
|
|
# Install guest-runner for microVM exec protocol
|
|
COPY guest-runner.sh /usr/local/bin/guest-runner.sh
|
|
RUN chmod +x /usr/local/bin/guest-runner.sh
|
|
|
|
WORKDIR /workspace
|
|
SHELL ["/bin/bash", "-c"]
|