|
| 1 | +# Parallel Code — Docker agent image |
| 2 | +# Pre-installs common dev tools so agents don't waste time on setup. |
| 3 | +# Build: docker build -t parallel-code-agent:latest docker/ |
| 4 | +# Size target: ~600 MB (multi-stage not needed; one fat layer is fine for a dev image) |
| 5 | + |
| 6 | +FROM ubuntu:22.04 |
| 7 | + |
| 8 | +ENV DEBIAN_FRONTEND=noninteractive \ |
| 9 | + LANG=C.UTF-8 \ |
| 10 | + LC_ALL=C.UTF-8 |
| 11 | + |
| 12 | +# Core build tools + languages |
| 13 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 14 | + # Basics |
| 15 | + ca-certificates curl wget git openssh-client gnupg \ |
| 16 | + # Build essentials |
| 17 | + build-essential pkg-config \ |
| 18 | + # Python |
| 19 | + python3 python3-pip python3-venv \ |
| 20 | + # Shells & utilities |
| 21 | + bash zsh jq ripgrep fd-find fzf tree unzip less \ |
| 22 | + # Process inspection |
| 23 | + procps \ |
| 24 | + # Networking |
| 25 | + dnsutils iputils-ping netcat-openbsd \ |
| 26 | + # Editor (agents sometimes need a $EDITOR) |
| 27 | + nano \ |
| 28 | + && rm -rf /var/lib/apt/lists/* |
| 29 | + |
| 30 | +# Add apt repos: NodeSource (Node 22 LTS) and GitHub CLI |
| 31 | +RUN mkdir -p /etc/apt/keyrings \ |
| 32 | + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \ |
| 33 | + | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ |
| 34 | + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" \ |
| 35 | + > /etc/apt/sources.list.d/nodesource.list \ |
| 36 | + && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \ |
| 37 | + | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ |
| 38 | + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \ |
| 39 | + > /etc/apt/sources.list.d/github-cli.list |
| 40 | + |
| 41 | +# Install Node.js, npm, and GitHub CLI in one layer |
| 42 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 43 | + nodejs \ |
| 44 | + git-lfs \ |
| 45 | + gh \ |
| 46 | + && rm -rf /var/lib/apt/lists/* \ |
| 47 | + && npm install -g npm@10 |
| 48 | + |
| 49 | +# Make fd and fdfind available as 'fd' |
| 50 | +RUN ln -sf "$(command -v fdfind)" /usr/local/bin/fd 2>/dev/null || true |
| 51 | + |
| 52 | +# Default git config so commits work out of the box inside containers |
| 53 | +RUN git config --system init.defaultBranch main \ |
| 54 | + && git config --system advice.detachedHead false |
| 55 | + |
| 56 | +# Non-root user — use --user 1000:1000 in docker run as needed |
| 57 | +RUN groupadd --gid 1000 agent \ |
| 58 | + && useradd --uid 1000 --gid agent --shell /bin/bash --create-home agent |
| 59 | + |
| 60 | +# Set a reasonable default shell |
| 61 | +ENV SHELL=/bin/bash |
| 62 | +WORKDIR /app |
| 63 | + |
| 64 | +CMD ["bash"] |
0 commit comments