Skip to content

Commit 5c5e9c2

Browse files
author
Chris
committed
initial commit
0 parents  commit 5c5e9c2

5 files changed

Lines changed: 179 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Push
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: caninehq/rover
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: docker/setup-buildx-action@v3
24+
25+
- uses: docker/login-action@v3
26+
if: github.event_name == 'push'
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- uses: docker/metadata-action@v5
33+
id: meta
34+
with:
35+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36+
tags: |
37+
type=sha
38+
type=raw,value=latest,enable={{is_default_branch}}
39+
40+
- uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
file: Dockerfile.sidecar
44+
platforms: linux/amd64,linux/arm64
45+
push: ${{ github.event_name == 'push' }}
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
.env
3+
*.log

Dockerfile.sidecar

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# Rover is Canine's managed coding-agent sidecar. It is intentionally generic:
4+
# Canine can exec commands inside it, mount the shared workspace, and layer in
5+
# agent-specific behavior later without rebuilding the project app image.
6+
7+
FROM docker.io/library/debian:bookworm-slim
8+
9+
ARG DEBIAN_FRONTEND=noninteractive
10+
ARG NODE_VERSION=22.14.0
11+
ARG YARN_VERSION=1.22.22
12+
ARG PNPM_VERSION=9.15.4
13+
ARG TARGETARCH
14+
15+
ENV LANG=C.UTF-8 \
16+
LC_ALL=C.UTF-8 \
17+
TERM=xterm-256color \
18+
WORKSPACE_DIR=/workspace
19+
20+
RUN apt-get update -qq && \
21+
apt-get install --no-install-recommends -y \
22+
bash \
23+
build-essential \
24+
ca-certificates \
25+
curl \
26+
fd-find \
27+
git \
28+
git-lfs \
29+
jq \
30+
less \
31+
openssh-client \
32+
patch \
33+
procps \
34+
python3 \
35+
python3-pip \
36+
ripgrep \
37+
ruby-full \
38+
shellcheck \
39+
software-properties-common \
40+
sqlite3 \
41+
sudo \
42+
tini \
43+
unzip \
44+
vim-tiny \
45+
wget \
46+
xz-utils && \
47+
ln -sf /usr/bin/fdfind /usr/local/bin/fd && \
48+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
49+
50+
RUN arch="$(case "${TARGETARCH:-amd64}" in amd64) echo x64 ;; arm64) echo arm64 ;; *) echo "${TARGETARCH}" ;; esac)" && \
51+
curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${arch}.tar.xz" \
52+
| tar -xJ --strip-components=1 -C /usr/local/ && \
53+
npm install -g "yarn@${YARN_VERSION}" "pnpm@${PNPM_VERSION}" && \
54+
npm cache clean --force
55+
56+
# Install coding agents
57+
RUN npm install -g @anthropic-ai/claude-code @openai/codex && \
58+
npm cache clean --force
59+
60+
COPY entrypoint.sh /usr/local/bin/rover-entrypoint
61+
RUN chmod +x /usr/local/bin/rover-entrypoint && \
62+
git lfs install --system
63+
64+
WORKDIR /workspace
65+
66+
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/rover-entrypoint"]
67+
CMD ["sleep", "infinity"]

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Rover Sidecar
2+
3+
`rover` is Canine's managed coding-agent sidecar image.
4+
5+
It is designed to:
6+
7+
- mount the same writable workspace volume as the user's development container
8+
- stay alive and ready for Canine to exec coding-agent commands into it
9+
- include a broad set of common developer tools without coupling the sidecar to a specific app stack
10+
- provide pre-installed coding agents (Claude Code, Codex)
11+
12+
## Pre-installed Coding Agents
13+
14+
| Agent | Command | Required Env Var |
15+
|-------|---------|-----------------|
16+
| Claude Code | `claude` | `ANTHROPIC_API_KEY` |
17+
| Codex | `codex` | `OPENAI_API_KEY` |
18+
19+
## Key Defaults
20+
21+
- workspace: `/workspace`
22+
- entrypoint: `rover-entrypoint`
23+
- default command: `sleep infinity`
24+
25+
## Build
26+
27+
```bash
28+
docker build -f resources/sidecars/rover/Dockerfile.sidecar -t canine/rover-sidecar:dev resources/sidecars/rover
29+
```
30+
31+
## Usage
32+
33+
API keys should be injected as environment variables when running the container:
34+
35+
```bash
36+
docker run -d \
37+
-e ANTHROPIC_API_KEY=sk-ant-... \
38+
-e OPENAI_API_KEY=sk-... \
39+
-v workspace:/workspace \
40+
canine/rover-sidecar:dev
41+
```
42+
43+
Then exec into the running container to invoke agents:
44+
45+
```bash
46+
docker exec -it <container> claude --print "fix the failing tests"
47+
docker exec -it <container> codex --quiet "add input validation"
48+
```

entrypoint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
workspace_dir="${WORKSPACE_DIR:-/workspace}"
5+
6+
mkdir -p "${workspace_dir}"
7+
cd "${workspace_dir}"
8+
9+
# Configure git safe directory for the workspace
10+
git config --global --add safe.directory "${workspace_dir}"
11+
12+
exec "$@"

0 commit comments

Comments
 (0)