Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/README/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pip
.local

container.claude.json
extra-tools.txt

!.claude/.gitkeep
!.codex/.gitkeep
Expand Down
16 changes: 6 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Code Container (`container`)

Repo: https://github.com/kevinMEH/code-container
Repo: https://github.com/drmikecrowe/code-container

This file contains instructions for AI coding assistants on how to setup and customize `container` for users.

Expand All @@ -15,17 +15,13 @@ Pre-setup:
- Read `./container.sh`

Setup: Do one step at a time. Do not overload the user with instructions.
1. Ask user to do this step: Install `container` as global command:
1. Ask user to run the installer:
```bash
ln -s "$(pwd)/container.sh" /usr/local/bin/container
curl -fsSL https://raw.githubusercontent.com/drmikecrowe/code-container/main/install.sh | bash
```
Do not ask user to run with `sudo`. If insufficient permissions, find an alternative location on user's `$PATH` to link to.
2. Do for user: Copy harness configs:
```bash
./copy-configs.sh
```
3. Do for user: Provide a list of included packages in `Dockerfile`. Then, ask user if they would like to add more packages into container environment. If yes, see `Add Packages/Dependencies` section below.
4. Do for user: Build Docker image:
This clones to `~/.local/share/code-container` and symlinks `container` onto their PATH. The installer is fully verbose and handles everything.
2. Do for user: Provide a list of included packages in `Dockerfile`. Then, ask user if they would like to add more packages into container environment. If yes, see `Add Packages/Dependencies` section below.
3. Do for user: Build Docker image:
```bash
container --build
```
Expand Down
82 changes: 48 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,65 @@ RUN apt-get update && apt-get install -y \
zlib1g-dev \
libffi-dev \
vim \
tree
tree \
gnupg \
iptables

# Install NVM (Node Version Manager) and Node.js
ENV NVM_DIR=/root/.nvm
ENV NODE_VERSION=22
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install ${NODE_VERSION} \
&& nvm use ${NODE_VERSION} \
&& nvm alias default ${NODE_VERSION} \
&& ln -sf "$NVM_DIR/versions/node/$(nvm current)/bin/"* /usr/local/bin/
# Install 1Password CLI and desktop app (for SSH signing with op-ssh-sign)
RUN curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | \
tee /etc/apt/sources.list.d/1password.list && \
apt-get update && apt-get install -y 1password 1password-cli && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update \
&& apt-get install -y \
python3 \
python3-dev \
python3-venv \
python3-pip
# Accept build-time username (defaults to ubuntu)
ARG USERNAME=ubuntu

# Create python symlink pointing to python3
RUN ln -sf /usr/bin/python3 /usr/bin/python
# Rename ubuntu user and move home to /container/$USERNAME
RUN mkdir -p /container && \
usermod -l ${USERNAME} ubuntu && \
groupmod -n ${USERNAME} ubuntu && \
usermod -d /container/${USERNAME} -m ${USERNAME}

# Install Claude Code globally via official installer
RUN curl -fsSL https://claude.ai/install.sh | bash
RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
USER ${USERNAME}
WORKDIR /container/${USERNAME}

# Install Opencode
RUN npm install -g opencode-ai
# Install mise (modern runtime manager)
RUN curl -fsSL https://mise.run | bash
ENV PATH="/container/${USERNAME}/.local/share/mise/shims:/container/${USERNAME}/.local/bin:${PATH}"

# Install OpenAI Codex CLI
RUN npm install -g @openai/codex
# Configure mise tools
RUN mise settings set experimental true && \
mise use -g \
node@22 \
pnpm@latest \
python@latest \
fd \
ripgrep \
"github:steveyegge/beads@latest" \
"github:steveyegge/gastown@latest" \
npm:opencode-ai \
npm:@openai/codex \
npm:@google/gemini-cli && \
mise install && \
mise trust ~/.config/mise/config.toml

# Install Gemini CLI
RUN npm install -g @google/gemini-cli
# Install extra user-specified tools (edit extra-tools.txt to add more)
COPY extra-tools.txt ./extra-tools.txt
RUN grep -v '^\s*#' extra-tools.txt | grep -v '^\s*$' | awk '{print $1}' | \
xargs -r mise use -g && mise install

# Set working directory to root home
WORKDIR /root
# Install Claude Code globally via official installer
RUN curl -fsSL https://claude.ai/install.sh | bash

# Configure bash prompt to show container name
RUN echo 'PS1="\[\033[01;32m\][code-container]\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$ "' >> /root/.bashrc
RUN echo 'PS1="\[\033[01;32m\][code-container]\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$ "' >> /container/${USERNAME}/.bashrc

# Source NVM in bashrc for interactive shells
RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /root/.bashrc \
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /root/.bashrc \
&& echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"' >> /root/.bashrc
# Source mise in bashrc for interactive shells
RUN echo 'eval "$(mise activate bash)"' >> /container/${USERNAME}/.bashrc && \
echo 'mise trust -a 2>/dev/null' >> /container/${USERNAME}/.bashrc && \
echo 'mise up 2>/dev/null' >> /container/${USERNAME}/.bashrc

# Default command: bash shell
CMD ["/bin/bash"]
Loading