Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fcd959ae1f | |||
| 149120ff6c | |||
| 50770b6e5f | |||
| 01d5ebbdb8 | |||
| d5338ab836 | |||
| a378c0f913 | |||
| c1f3fdbb90 | |||
| 60f96fc8da | |||
| a300e8e810 | |||
| b5ee7c84de | |||
| 02c4f864f7 | |||
| ea966fadab | |||
| f0e70438db | |||
| 0fe568a7d6 | |||
| 7235d2dc67 | |||
| 7940e80cf0 | |||
| f6cbec05f6 | |||
| 9175d48844 | |||
| cb60f2a428 | |||
| 1179897cba | |||
| 46dc486cb4 | |||
| 41ec70c7da | |||
| e3f751240a | |||
| e6c3b7f7bf | |||
| 41e270ec32 | |||
| 05b06d1d90 | |||
| 8736d5b500 | |||
| 713e5eebe6 | |||
| 276477e245 | |||
| 2136976b8e | |||
| e269e19f23 | |||
| 3109de7e2e | |||
| 2b9350c86d | |||
| 5d62842aec | |||
| 58719cf262 | |||
| c066aa49be | |||
| 204a673b3d | |||
| 04ed52bc8d | |||
| c670dd124f | |||
| 219af987ae | |||
| c70352dc41 | |||
| f689b27b78 | |||
| a978b505d0 | |||
| 69497b1ec6 | |||
| 698c5810a0 | |||
| 2582c1d824 | |||
| 6dd560f2ad | |||
| 19d47da079 | |||
| 12d3444cc5 | |||
| eeb995e1fc | |||
| d26b69c587 | |||
| cc38a07168 | |||
| 5c3600a424 | |||
| 5565354127 | |||
| b69cd80cae |
@@ -19,7 +19,6 @@
|
||||
- [ ] Built Docker image locally
|
||||
- [ ] Tested container startup
|
||||
- [ ] Tested repository cloning
|
||||
- [ ] Tested Happy Coder integration
|
||||
- [ ] Tested VNC web interface
|
||||
|
||||
## Checklist
|
||||
|
||||
@@ -16,10 +16,12 @@ env:
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
if: >-
|
||||
github.event_name != 'push'
|
||||
|| !contains(github.event.head_commit.message, '[skip ci]')
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -54,6 +56,7 @@ jobs:
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: CACHE_BUST=${{ github.sha }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64
|
||||
|
||||
@@ -16,7 +16,9 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/main'
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
|
||||
@@ -96,12 +96,13 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
build-args: CACHE_BUST=${{ github.sha }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.tag }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64
|
||||
|
||||
- name: Publish Helm Chart to GitHub Pages
|
||||
@@ -156,34 +157,37 @@ jobs:
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
TAG: ${{ steps.version.outputs.tag }}
|
||||
IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.tag }}
|
||||
run: |
|
||||
# Build release notes
|
||||
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||
PREV_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
|
||||
if [ -z "$PREV_TAG" ]; then
|
||||
COMMITS=$(git log --pretty=format:"- %s (%h)" HEAD)
|
||||
else
|
||||
COMMITS=$(git log --pretty=format:"- %s (%h)" "${PREV_TAG}..HEAD")
|
||||
fi
|
||||
|
||||
cat > release-notes.md <<EOF
|
||||
## Release ${{ steps.version.outputs.version }}
|
||||
cat > release-notes.md <<NOTESEOF
|
||||
## Release ${VERSION}
|
||||
|
||||
### Changes
|
||||
${COMMITS}
|
||||
|
||||
### Docker Image
|
||||
\`\`\`bash
|
||||
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.tag }}
|
||||
docker pull ${IMAGE}
|
||||
\`\`\`
|
||||
|
||||
### Helm Chart
|
||||
\`\`\`bash
|
||||
helm repo add devcontainer https://cpfarhood.github.io/devcontainer
|
||||
helm repo update
|
||||
helm install mydev devcontainer/devcontainer --version ${{ steps.version.outputs.version }} --set name=mydev
|
||||
helm install mydev devcontainer/devcontainer --version ${VERSION} --set name=mydev
|
||||
\`\`\`
|
||||
EOF
|
||||
NOTESEOF
|
||||
sed -i 's/^ //' release-notes.md
|
||||
|
||||
gh release create "${{ steps.version.outputs.tag }}" \
|
||||
--title "Release ${{ steps.version.outputs.tag }}" \
|
||||
gh release create "${TAG}" \
|
||||
--title "Release ${TAG}" \
|
||||
--notes-file release-notes.md
|
||||
|
||||
@@ -18,11 +18,6 @@
|
||||
"playwright": {
|
||||
"type": "sse",
|
||||
"url": "http://localhost:8086/sse"
|
||||
},
|
||||
"pgtuner": {
|
||||
"type": "sse",
|
||||
"url": "http://localhost:8085/sse"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
The Dev Container is a Docker-based cloud development environment that provides:
|
||||
- Web-based GUI IDE (VSCode/Antigravity) via VNC on port 5800
|
||||
- Claude Code, Happy Coder, OpenCode, and Crush AI coding agents (terminal-based)
|
||||
- Claude Code, OpenCode, and Crush AI coding agents (terminal-based)
|
||||
- Built-in web file manager for uploading/downloading files (optional, via `fileManager.enabled`)
|
||||
- Automatic GitHub repository cloning on startup
|
||||
- Kubernetes-native deployment with persistent home storage
|
||||
@@ -61,7 +61,8 @@ Container start
|
||||
→ scripts/startapp.sh
|
||||
→ scripts/init-repo.sh
|
||||
→ Configure git user & credentials
|
||||
→ Clone GITHUB_REPO (if set)
|
||||
→ Clone GITHUB_REPOS or GITHUB_REPO (if set)
|
||||
→ Generate workspace.code-workspace for multi-repo setups
|
||||
→ Launch VSCode as user `user` in /workspace
|
||||
```
|
||||
|
||||
@@ -69,8 +70,8 @@ Container start
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `Dockerfile` | Image definition — installs Chrome, Node.js, VSCode, Helm, Claude Code, Happy Coder, OpenCode, Crush; creates non-root user (UID 1000) |
|
||||
| `scripts/init-repo.sh` | Configures git credentials, clones GitHub repo |
|
||||
| `Dockerfile` | Image definition — installs Chrome, VSCode, Helm, gh CLI, kubeseal, Claude Code, OpenCode, Crush, LSP servers (pyright, typescript-language-server, gopls, clangd, rust-analyzer, lua-language-server, jdtls, kotlin-language-server, intelephense); creates non-root user (UID 1000) |
|
||||
| `scripts/init-repo.sh` | Configures git credentials, clones GitHub repo(s), generates multi-root workspace file |
|
||||
| `scripts/startapp.sh` | Calls init-repo.sh then opens VSCode in the workspace |
|
||||
| `chart/` | Helm chart for Kubernetes deployment |
|
||||
| `chart/templates/deployment.yaml` | Deployment spec — main container + MCP sidecar containers |
|
||||
@@ -78,7 +79,7 @@ Container start
|
||||
| `chart/templates/pvc.yaml` | PersistentVolumeClaim for user home |
|
||||
| `chart/templates/service.yaml` | ClusterIP Service (VNC + optional SSH) |
|
||||
| `chart/values.yaml` | Default Helm values |
|
||||
| `.mcp.json` | MCP server connection config (GitHub Copilot, Kubernetes, Flux, Fetch, Sequential Thinking, Playwright, pgtuner) |
|
||||
| `.mcp.json` | MCP server connection config (GitHub Copilot, Kubernetes, Flux, Helm, Fetch, Sequential Thinking, Playwright, pgtuner) |
|
||||
| `Makefile` | Build/deploy automation |
|
||||
|
||||
### MCP Sidecars
|
||||
@@ -89,6 +90,7 @@ MCP (Model Context Protocol) servers run as sidecar containers in the pod, enabl
|
||||
|---------|-------|---------|------|----------|---------|
|
||||
| `kubernetes-mcp` | `quay.io/containers/kubernetes_mcp_server` | v0.0.57 | 8080 | `http://localhost:8080/sse` | Enabled |
|
||||
| `flux-mcp` | `ghcr.io/controlplaneio-fluxcd/flux-operator-mcp` | v0.41.1 | 8081 | `http://localhost:8081/sse` | Enabled |
|
||||
| `helm-mcp` | `ghcr.io/zekker6/mcp-helm` | v1.3.1 | 8012 | `http://localhost:8012/sse` | Enabled |
|
||||
| `fetch-mcp` | `mcp/fetch` | latest | 8082 | `http://localhost:8082/sse` | Enabled |
|
||||
| `sequentialthinking-mcp` | `mcp/sequentialthinking` | latest | 8083 | `http://localhost:8083/sse` | Enabled |
|
||||
| `homeassistant-mcp` | `ghcr.io/homeassistant-ai/ha-mcp` | stable | 8087 | `http://localhost:8087/sse` | Disabled |
|
||||
@@ -99,6 +101,7 @@ MCP (Model Context Protocol) servers run as sidecar containers in the pod, enabl
|
||||
- GitHub MCP is accessed via the Copilot API (`https://api.githubcopilot.com/mcp/`), not as a sidecar
|
||||
- Kubernetes and Flux sidecars require `clusterAccess` != `none` to be deployed (they need RBAC permissions)
|
||||
- Kubernetes and Flux sidecars inherit the pod's ServiceAccount RBAC permissions
|
||||
- Helm sidecar enables browsing Helm repositories and chart metadata
|
||||
- Fetch sidecar provides web content fetching capabilities and HTML to markdown conversion
|
||||
- Sequential thinking sidecar enables structured thinking and problem-solving processes
|
||||
- Home Assistant sidecar requires `HOMEASSISTANT_URL` and `HOMEASSISTANT_TOKEN` in the env secret
|
||||
@@ -117,6 +120,8 @@ mcp:
|
||||
enabled: false
|
||||
flux:
|
||||
enabled: false
|
||||
helm:
|
||||
enabled: false
|
||||
fetch:
|
||||
enabled: false
|
||||
sequentialthinking:
|
||||
@@ -135,6 +140,8 @@ mcp:
|
||||
enabled: true # Keep Kubernetes MCP enabled
|
||||
flux:
|
||||
enabled: false # Disable Flux MCP
|
||||
helm:
|
||||
enabled: true # Enable Helm MCP for chart browsing
|
||||
fetch:
|
||||
enabled: true # Enable Fetch MCP for web content fetching
|
||||
sequentialthinking:
|
||||
@@ -171,8 +178,9 @@ helm install my-devcontainer ./chart -f custom-values.yaml
|
||||
|
||||
### Environment Variables
|
||||
|
||||
**Required:**
|
||||
- `GITHUB_REPO` — URL of repository to clone into `/workspace`
|
||||
**Required (at least one):**
|
||||
- `GITHUB_REPO` — URL of a single repository to clone into `/workspace`
|
||||
- `GITHUB_REPOS` — Comma-separated list of repository URLs to clone (takes precedence over `GITHUB_REPO`). When multiple repos are cloned, a `workspace.code-workspace` file is generated for multi-root IDE support.
|
||||
|
||||
**Optional:**
|
||||
- `GITHUB_TOKEN` — PAT for private repo access (automatically configures git credentials)
|
||||
@@ -182,8 +190,6 @@ helm install my-devcontainer ./chart -f custom-values.yaml
|
||||
- `VNC_PASSWORD` — VNC web interface password
|
||||
- `DISPLAY_WIDTH` / `DISPLAY_HEIGHT` — VNC resolution
|
||||
- `USER_ID` / `GROUP_ID` — Override UID/GID (default 1000)
|
||||
- `HAPPY_SERVER_URL` / `HAPPY_WEBAPP_URL` — Custom Happy Coder endpoints
|
||||
- `HAPPY_HOME_DIR` / `HAPPY_EXPERIMENTAL`
|
||||
- `WEB_FILE_MANAGER` — Set to `1` to enable the built-in web file manager (controlled via `fileManager.enabled` in Helm values)
|
||||
- `WEB_FILE_MANAGER_ALLOWED_PATHS` — Paths accessible by the file manager (default: `/workspace,/config`)
|
||||
- `WEB_FILE_MANAGER_DENIED_PATHS` — Paths to deny access to (takes precedence over allowed)
|
||||
|
||||
@@ -225,18 +225,6 @@ spec:
|
||||
|
||||
## Advanced Configurations
|
||||
|
||||
### Custom Happy Coder Endpoints
|
||||
|
||||
For self-hosted Happy instances:
|
||||
|
||||
```bash
|
||||
helm install mydev ./chart \
|
||||
--set name=mydev \
|
||||
--set githubRepo=https://github.com/youruser/yourrepo \
|
||||
--set happyServerUrl=https://your-happy-server.com \
|
||||
--set happyWebappUrl=https://your-happy-webapp.com
|
||||
```
|
||||
|
||||
### Custom Display Resolution
|
||||
|
||||
```bash
|
||||
|
||||
+95
-8
@@ -1,5 +1,8 @@
|
||||
FROM jlesage/baseimage-gui:ubuntu-22.04-v4
|
||||
|
||||
# Bust cache for all layers below (base image pull is still cached)
|
||||
ARG CACHE_BUST
|
||||
|
||||
# Set environment variables
|
||||
ENV APP_NAME="Dev Container" \
|
||||
KEEP_APP_RUNNING=1 \
|
||||
@@ -56,13 +59,22 @@ exec /usr/bin/google-chrome-stable \\\n\
|
||||
"$@"\n' > /usr/local/bin/google-chrome && \
|
||||
chmod +x /usr/local/bin/google-chrome
|
||||
|
||||
# Install Node.js (LTS version for Happy Coder)
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
|
||||
# Install Node.js LTS via NodeSource
|
||||
ARG NODE_MAJOR=22
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_MAJOR}.x | bash - && \
|
||||
apt-get install -y nodejs && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
node --version && npm --version
|
||||
|
||||
# Install Happy Coder and Claude Code globally
|
||||
RUN npm install -g happy-coder @anthropic-ai/claude-code
|
||||
# Install Claude Code native binary (npm wrapper breaks remote control)
|
||||
RUN curl -fsSL https://claude.ai/install.sh | bash && \
|
||||
cp /root/.local/bin/claude /usr/local/bin/claude && \
|
||||
rm -rf /root/.local/bin/claude && \
|
||||
claude --version
|
||||
|
||||
# Disable Claude Code auto-updater (doesn't work inside Docker)
|
||||
RUN mkdir -p /etc/skel/.claude && \
|
||||
echo '{"env":{"DISABLE_AUTOUPDATER":"1"}}' > /etc/skel/.claude/settings.json
|
||||
|
||||
# Install OpenCode AI coding agent
|
||||
RUN OPENCODE_VERSION=$(curl -sL https://api.github.com/repos/opencode-ai/opencode/releases/latest | jq -r '.tag_name') && \
|
||||
@@ -84,9 +96,84 @@ RUN curl -fsSL "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" |
|
||||
tar -xz --strip-components=1 -C /usr/local/bin linux-amd64/helm && \
|
||||
chmod +x /usr/local/bin/helm
|
||||
|
||||
# Install VSCode
|
||||
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/packages.microsoft.gpg && \
|
||||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list && \
|
||||
# Install OpenTofu (open-source Terraform alternative)
|
||||
ARG OPENTOFU_VERSION=1.11.5
|
||||
RUN curl -fsSL "https://github.com/opentofu/opentofu/releases/download/v${OPENTOFU_VERSION}/tofu_${OPENTOFU_VERSION}_linux_amd64.zip" -o /tmp/tofu.zip && \
|
||||
unzip -o /tmp/tofu.zip -d /usr/local/bin tofu && \
|
||||
chmod +x /usr/local/bin/tofu && \
|
||||
rm /tmp/tofu.zip
|
||||
|
||||
# Install GitHub CLI (gh) via official APT repo
|
||||
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
|
||||
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
|
||||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y gh && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install kubeseal CLI for Bitnami Sealed Secrets
|
||||
RUN KUBESEAL_VERSION=$(curl -sL https://api.github.com/repos/bitnami-labs/sealed-secrets/releases/latest | jq -r '.tag_name' | sed 's/^v//') && \
|
||||
curl -fsSL "https://github.com/bitnami-labs/sealed-secrets/releases/download/v${KUBESEAL_VERSION}/kubeseal-${KUBESEAL_VERSION}-linux-amd64.tar.gz" | \
|
||||
tar -xz -C /usr/local/bin kubeseal && \
|
||||
chmod +x /usr/local/bin/kubeseal
|
||||
|
||||
# ── LSP servers for Claude Code language intelligence ──
|
||||
|
||||
# npm-based LSP servers: Python (pyright), TypeScript/JavaScript, PHP
|
||||
RUN npm install -g pyright typescript-language-server typescript intelephense
|
||||
|
||||
# Install Go runtime and gopls LSP server
|
||||
ARG GO_VERSION=1.23.6
|
||||
RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -xz -C /usr/local && \
|
||||
/usr/local/go/bin/go install golang.org/x/tools/gopls@latest && \
|
||||
mv /root/go/bin/gopls /usr/local/bin/gopls && \
|
||||
rm -rf /root/go
|
||||
ENV PATH="/usr/local/go/bin:${PATH}"
|
||||
|
||||
# Install clangd LSP server (C/C++)
|
||||
RUN apt-get update && \
|
||||
apt-get install -y clangd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install rust-analyzer LSP server (Rust) — standalone binary, no full toolchain needed
|
||||
RUN RUST_ANALYZER_VERSION=$(curl -sL https://api.github.com/repos/rust-lang/rust-analyzer/releases/latest | jq -r '.tag_name') && \
|
||||
curl -fsSL "https://github.com/rust-lang/rust-analyzer/releases/download/${RUST_ANALYZER_VERSION}/rust-analyzer-x86_64-unknown-linux-gnu.gz" | \
|
||||
gunzip > /usr/local/bin/rust-analyzer && \
|
||||
chmod +x /usr/local/bin/rust-analyzer
|
||||
|
||||
# Install lua-language-server (Lua)
|
||||
RUN LUA_LS_VERSION=$(curl -sL https://api.github.com/repos/LuaLS/lua-language-server/releases/latest | jq -r '.tag_name') && \
|
||||
mkdir -p /opt/lua-language-server && \
|
||||
curl -fsSL "https://github.com/LuaLS/lua-language-server/releases/download/${LUA_LS_VERSION}/lua-language-server-${LUA_LS_VERSION}-linux-x64.tar.gz" | \
|
||||
tar -xz -C /opt/lua-language-server && \
|
||||
ln -s /opt/lua-language-server/bin/lua-language-server /usr/local/bin/lua-language-server
|
||||
|
||||
# Install JDK for Java/Kotlin LSP servers
|
||||
RUN apt-get update && \
|
||||
apt-get install -y openjdk-17-jdk-headless && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install kotlin-language-server
|
||||
RUN KLS_VERSION=$(curl -sL https://api.github.com/repos/fwcd/kotlin-language-server/releases/latest | jq -r '.tag_name') && \
|
||||
curl -fsSL "https://github.com/fwcd/kotlin-language-server/releases/download/${KLS_VERSION}/server.zip" -o /tmp/kls.zip && \
|
||||
unzip -o /tmp/kls.zip -d /opt/kotlin-language-server && \
|
||||
ln -s /opt/kotlin-language-server/server/bin/kotlin-language-server /usr/local/bin/kotlin-language-server && \
|
||||
rm /tmp/kls.zip
|
||||
|
||||
# Install jdtls (Java LSP) — Eclipse JDT Language Server
|
||||
RUN JDTLS_VERSION=$(curl -sL https://api.github.com/repos/eclipse-jdtls/eclipse.jdt.ls/releases/latest | jq -r '.tag_name' | sed 's/^v//') && \
|
||||
JDTLS_URL=$(curl -sL https://api.github.com/repos/eclipse-jdtls/eclipse.jdt.ls/releases/latest | jq -r '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url' | head -1) && \
|
||||
mkdir -p /opt/jdtls && \
|
||||
curl -fsSL "$JDTLS_URL" | tar -xz -C /opt/jdtls && \
|
||||
printf '#!/bin/bash\nexec java -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -jar /opt/jdtls/plugins/org.eclipse.equinox.launcher_*.jar -configuration /opt/jdtls/config_linux "$@"\n' > /usr/local/bin/jdtls && \
|
||||
chmod +x /usr/local/bin/jdtls
|
||||
|
||||
# Install VSCode (using Microsoft's current recommended setup)
|
||||
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg && \
|
||||
install -D -o root -g root -m 644 /tmp/microsoft.gpg /usr/share/keyrings/microsoft.gpg && \
|
||||
rm -f /tmp/microsoft.gpg && \
|
||||
printf 'Types: deb\nURIs: https://packages.microsoft.com/repos/code\nSuites: stable\nComponents: main\nArchitectures: amd64\nSigned-By: /usr/share/keyrings/microsoft.gpg\n' \
|
||||
> /etc/apt/sources.list.d/vscode.sources && \
|
||||
apt-get update && \
|
||||
apt-get install -y code && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -26,7 +26,6 @@ run:
|
||||
-e GITHUB_REPO="${GITHUB_REPO}" \
|
||||
-e GITHUB_TOKEN="${GITHUB_TOKEN}" \
|
||||
-e VNC_PASSWORD="${VNC_PASSWORD}" \
|
||||
-e HAPPY_EXPERIMENTAL="true" \
|
||||
-v $(PWD)/home:/home \
|
||||
-v $(PWD)/workspace:/workspace \
|
||||
--name devcontainer \
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
A containerized cloud development environment with web-based GUI access, featuring:
|
||||
- **VSCode or Google Antigravity** via browser-based VNC (port 5800)
|
||||
- **SSH access** option (OpenSSH on port 22, additive with any IDE)
|
||||
- **Claude Code**, **Happy Coder**, **OpenCode**, and **Crush** AI coding agents (terminal-based)
|
||||
- **Claude Code**, **OpenCode**, and **Crush** AI coding agents (terminal-based)
|
||||
- **Built-in web file manager** for uploading/downloading files via the VNC web interface
|
||||
- **Helm CLI** included for Kubernetes chart development and deployment
|
||||
- **Automatic GitHub repo cloning** on startup
|
||||
@@ -114,7 +114,7 @@ The Helm chart uses a logical organization with these main sections:
|
||||
- **Basic Configuration**: name, image, githubRepo
|
||||
- **Access & Interface**: IDE, SSH, display, user settings
|
||||
- **Infrastructure**: storage, resources, cluster access
|
||||
- **Integrations**: Happy Coder, MCP sidecars
|
||||
- **Integrations**: MCP sidecars
|
||||
- **Smart Defaults**: auto-detection and profiles
|
||||
|
||||
📖 **Documentation**:
|
||||
@@ -189,15 +189,6 @@ helm install mydev ./chart \
|
||||
--set fileManager.enabled=true
|
||||
```
|
||||
|
||||
### Happy Coder
|
||||
|
||||
| Value | Default | Description |
|
||||
|-------|---------|-------------|
|
||||
| `happy.serverUrl` | `https://happy.farh.net` | Happy Coder server endpoint |
|
||||
| `happy.webappUrl` | `https://happy-coder.farh.net` | Happy Coder webapp URL |
|
||||
| `happy.homeDir` | `/config/userdata/.happy` | Happy runtime state directory (persists on the home PVC) |
|
||||
| `happy.experimental` | `true` | Enable experimental Happy features |
|
||||
|
||||
### Kubernetes cluster access
|
||||
|
||||
The `clusterAccess` value provisions a ServiceAccount, Role/ClusterRole, and binding so the devcontainer pod can interact with the Kubernetes API. The default is `none` — no RBAC resources are created.
|
||||
@@ -377,30 +368,10 @@ Container start
|
||||
| `/config` | ReadWriteMany PVC (`userhome-{name}`) | Survives pod restarts — stores Claude credentials, dotfiles, git config |
|
||||
| `/workspace` | `emptyDir` | Ephemeral — repo is re-cloned on each pod start |
|
||||
|
||||
Happy Coder's runtime state (`HAPPY_HOME_DIR`) is kept in `/config/userdata/.happy` on the persistent home PVC, so auth credentials and settings survive pod restarts when manually started.
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Happy Coder (manual startup)
|
||||
|
||||
Happy daemon is not started automatically. Launch it manually when needed:
|
||||
|
||||
```bash
|
||||
# Start Happy Coder daemon manually
|
||||
happy daemon start
|
||||
|
||||
# Check daemon status
|
||||
happy daemon status
|
||||
|
||||
# View daemon logs
|
||||
ls ~/.happy/logs/
|
||||
|
||||
# Stop daemon if needed
|
||||
happy daemon stop
|
||||
```
|
||||
|
||||
### Claude not authenticated
|
||||
|
||||
Browser-based OAuth login is the primary method (works inside VNC via the Chrome wrapper). If you prefer API key auth:
|
||||
@@ -466,4 +437,4 @@ The image is also built and pushed automatically by CI on every push to `main` a
|
||||
## Credits
|
||||
|
||||
- Base image: [jlesage/docker-baseimage-gui](https://github.com/jlesage/docker-baseimage-gui)
|
||||
- AI assistant: [Happy Coder](https://happy.engineering) + [Claude](https://claude.ai)
|
||||
- AI assistant: [Claude](https://claude.ai)
|
||||
|
||||
@@ -52,30 +52,6 @@ Complete reference for all configurable values in the Antigravity Dev Container
|
||||
- **Options:** `Always`, `IfNotPresent`, `Never`
|
||||
- **Description:** Image pull policy
|
||||
|
||||
## Happy Coder Configuration
|
||||
|
||||
### happyServerUrl
|
||||
- **Type:** String
|
||||
- **Default:** `https://happy.farh.net`
|
||||
- **Description:** Happy Coder server endpoint
|
||||
- **When to Change:** Self-hosted Happy instance
|
||||
|
||||
### happyWebappUrl
|
||||
- **Type:** String
|
||||
- **Default:** `https://happy-coder.farh.net`
|
||||
- **Description:** Happy Coder webapp URL
|
||||
- **When to Change:** Self-hosted Happy instance
|
||||
|
||||
### happyHomeDir
|
||||
- **Type:** String
|
||||
- **Default:** `/config/userdata/.happy`
|
||||
- **Description:** Happy runtime state directory (persists on PVC)
|
||||
|
||||
### happyExperimental
|
||||
- **Type:** String
|
||||
- **Default:** `"true"`
|
||||
- **Description:** Enable experimental Happy features
|
||||
|
||||
## Display Configuration
|
||||
|
||||
### display.width
|
||||
@@ -339,8 +315,6 @@ storage:
|
||||
|
||||
clusterAccess: readonly
|
||||
|
||||
happyServerUrl: https://happy.internal.company.com
|
||||
happyWebappUrl: https://happy-app.internal.company.com
|
||||
```
|
||||
|
||||
### Smart Home Development Configuration
|
||||
@@ -431,10 +405,6 @@ These environment variables are set in the container based on chart values:
|
||||
| `VNC_PASSWORD` | Secret: `vnc-password` | VNC access password |
|
||||
| `ANTHROPIC_API_KEY` | Secret: `anthropic-api-key` | Claude API key |
|
||||
| `SSH_AUTHORIZED_KEYS` | Secret: `ssh-authorized-keys` | SSH public keys |
|
||||
| `HAPPY_SERVER_URL` | `happyServerUrl` | Happy server endpoint |
|
||||
| `HAPPY_WEBAPP_URL` | `happyWebappUrl` | Happy webapp URL |
|
||||
| `HAPPY_HOME_DIR` | `happyHomeDir` | Happy data directory |
|
||||
| `HAPPY_EXPERIMENTAL` | `happyExperimental` | Experimental features |
|
||||
| `DISPLAY_WIDTH` | `display.width` | VNC width |
|
||||
| `DISPLAY_HEIGHT` | `display.height` | VNC height |
|
||||
| `SECURE_CONNECTION` | `secureConnection` | TLS termination |
|
||||
|
||||
+6
-1
@@ -2,5 +2,10 @@ apiVersion: v2
|
||||
name: devcontainer
|
||||
description: Dev Container with AI coding agents and MCP sidecars
|
||||
type: application
|
||||
version: 1.0.2
|
||||
version: 2.5.0
|
||||
appVersion: "latest"
|
||||
keywords:
|
||||
- development
|
||||
- devcontainer
|
||||
- vscode
|
||||
- ai
|
||||
|
||||
@@ -79,16 +79,14 @@ spec:
|
||||
value: {{ .Values.fileManager.deniedPaths | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: HAPPY_HOME_DIR
|
||||
value: {{ .Values.happy.homeDir | quote }}
|
||||
- name: HAPPY_EXPERIMENTAL
|
||||
value: {{ .Values.happy.experimental | quote }}
|
||||
- name: HAPPY_SERVER_URL
|
||||
value: {{ .Values.happy.serverUrl | quote }}
|
||||
- name: HAPPY_WEBAPP_URL
|
||||
value: {{ .Values.happy.webappUrl | quote }}
|
||||
{{- if .Values.githubRepo }}
|
||||
- name: GITHUB_REPO
|
||||
value: {{ .Values.githubRepo | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.githubRepos }}
|
||||
- name: GITHUB_REPOS
|
||||
value: {{ join "," .Values.githubRepos | quote }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: {{ include "devcontainer.envSecretName" . }}
|
||||
@@ -176,6 +174,28 @@ spec:
|
||||
resources:
|
||||
{{- toYaml .Values.mcp.sidecars.flux.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mcp.sidecars.helm.enabled }}
|
||||
- name: helm-mcp
|
||||
image: "{{ .Values.mcp.sidecars.helm.image.repository }}:{{ .Values.mcp.sidecars.helm.image.tag }}"
|
||||
args:
|
||||
- -mode=sse
|
||||
ports:
|
||||
- containerPort: {{ .Values.mcp.sidecars.helm.port }}
|
||||
name: helm-mcp
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: {{ .Values.mcp.sidecars.helm.port }}
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: {{ .Values.mcp.sidecars.helm.port }}
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
resources:
|
||||
{{- toYaml .Values.mcp.sidecars.helm.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mcp.sidecars.homeassistant.enabled }}
|
||||
- name: homeassistant-mcp
|
||||
image: "{{ .Values.mcp.sidecars.homeassistant.image.repository }}:{{ .Values.mcp.sidecars.homeassistant.image.tag }}"
|
||||
|
||||
@@ -8,6 +8,11 @@ name: mydev
|
||||
# GitHub repository to clone (required)
|
||||
githubRepo: https://github.com/youruser/yourrepo
|
||||
|
||||
# Multiple repositories (optional, takes precedence over githubRepo)
|
||||
# githubRepos:
|
||||
# - https://github.com/youruser/repo1
|
||||
# - https://github.com/youruser/repo2
|
||||
|
||||
# IDE choice (optional - defaults to vscode)
|
||||
# Options: vscode | antigravity | none
|
||||
ide:
|
||||
|
||||
+27
-25
@@ -34,8 +34,30 @@
|
||||
},
|
||||
"githubRepo": {
|
||||
"type": "string",
|
||||
"description": "GitHub repository URL to clone",
|
||||
"pattern": "^https?://.+/.+/.+$"
|
||||
"description": "GitHub repository URL to clone into /workspace"
|
||||
},
|
||||
"githubRepos": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "Multiple GitHub repository URLs to clone (takes precedence over githubRepo)"
|
||||
},
|
||||
"fileManager": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"description": "Enable the built-in web file manager"
|
||||
},
|
||||
"allowedPaths": {
|
||||
"type": "string",
|
||||
"description": "Paths accessible by the file manager (AUTO, ALL, or comma-separated list)"
|
||||
},
|
||||
"deniedPaths": {
|
||||
"type": "string",
|
||||
"description": "Paths to deny access to (takes precedence over allowedPaths)"
|
||||
}
|
||||
},
|
||||
"required": ["enabled"]
|
||||
},
|
||||
"ide": {
|
||||
"type": "object",
|
||||
@@ -138,29 +160,6 @@
|
||||
"enum": ["none", "readonlyns", "readwritens", "readonly", "readwrite"],
|
||||
"description": "Kubernetes cluster access level"
|
||||
},
|
||||
"happy": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"serverUrl": {
|
||||
"type": "string",
|
||||
"description": "Happy Coder server URL"
|
||||
},
|
||||
"webappUrl": {
|
||||
"type": "string",
|
||||
"description": "Happy Coder webapp URL"
|
||||
},
|
||||
"homeDir": {
|
||||
"type": "string",
|
||||
"description": "Happy Coder home directory"
|
||||
},
|
||||
"experimental": {
|
||||
"type": "string",
|
||||
"enum": ["true", "false"],
|
||||
"description": "Enable experimental Happy features"
|
||||
}
|
||||
},
|
||||
"required": ["homeDir", "experimental"]
|
||||
},
|
||||
"mcp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -179,6 +178,9 @@
|
||||
"pgtuner": {
|
||||
"$ref": "#/$defs/mcpSidecar"
|
||||
},
|
||||
"helm": {
|
||||
"$ref": "#/$defs/mcpSidecar"
|
||||
},
|
||||
"playwright": {
|
||||
"$ref": "#/$defs/mcpSidecar"
|
||||
}
|
||||
|
||||
+22
-8
@@ -14,6 +14,13 @@ image:
|
||||
# GitHub repository to clone into /workspace
|
||||
githubRepo: ""
|
||||
|
||||
# Multiple GitHub repositories to clone into /workspace (takes precedence over githubRepo)
|
||||
# Example:
|
||||
# githubRepos:
|
||||
# - https://github.com/user/repo1
|
||||
# - https://github.com/user/repo2
|
||||
githubRepos: []
|
||||
|
||||
# =============================================================================
|
||||
# ACCESS & INTERFACE
|
||||
# =============================================================================
|
||||
@@ -78,13 +85,6 @@ clusterAccess: none
|
||||
# INTEGRATIONS
|
||||
# =============================================================================
|
||||
|
||||
# Happy Coder AI assistant configuration
|
||||
happy:
|
||||
serverUrl: ""
|
||||
webappUrl: ""
|
||||
homeDir: "/config/userdata/.happy"
|
||||
experimental: "true"
|
||||
|
||||
# MCP (Model Context Protocol) server sidecars
|
||||
mcp:
|
||||
sidecars:
|
||||
@@ -119,13 +119,27 @@ mcp:
|
||||
cpu: "500m"
|
||||
|
||||
|
||||
# Helm chart browsing and management
|
||||
helm:
|
||||
enabled: false
|
||||
image:
|
||||
repository: ghcr.io/zekker6/mcp-helm
|
||||
tag: v1.3.1
|
||||
port: 8012
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "500m"
|
||||
|
||||
# Home Assistant smart home control
|
||||
homeassistant:
|
||||
enabled: false # Requires HOMEASSISTANT_URL and HOMEASSISTANT_TOKEN
|
||||
image:
|
||||
repository: ghcr.io/homeassistant-ai/ha-mcp
|
||||
tag: v6.7.1
|
||||
tag: "6.7.1"
|
||||
port: 8087
|
||||
resources:
|
||||
requests:
|
||||
|
||||
+72
-24
@@ -62,48 +62,96 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if GITHUB_REPO is set
|
||||
if [ -z "$GITHUB_REPO" ]; then
|
||||
echo "GITHUB_REPO not set, skipping repository clone"
|
||||
# Build list of repositories to clone
|
||||
REPOS=()
|
||||
if [ -n "$GITHUB_REPOS" ]; then
|
||||
# GITHUB_REPOS is a comma-separated list (takes precedence over GITHUB_REPO)
|
||||
IFS=',' read -ra RAW_REPOS <<< "$GITHUB_REPOS"
|
||||
for repo in "${RAW_REPOS[@]}"; do
|
||||
repo="$(echo "$repo" | xargs)" # trim whitespace
|
||||
[ -n "$repo" ] && REPOS+=("$repo")
|
||||
done
|
||||
elif [ -n "$GITHUB_REPO" ]; then
|
||||
REPOS+=("$GITHUB_REPO")
|
||||
fi
|
||||
|
||||
if [ ${#REPOS[@]} -eq 0 ]; then
|
||||
echo "No repositories configured, skipping clone"
|
||||
WORKSPACE_DIR="/workspace/default"
|
||||
mkdir -p "$WORKSPACE_DIR"
|
||||
else
|
||||
# Parse repo name from URL
|
||||
REPO_NAME=$(basename "$GITHUB_REPO" .git)
|
||||
WORKSPACE_DIR="/workspace/$REPO_NAME"
|
||||
CLONED_DIRS=()
|
||||
for REPO_URL in "${REPOS[@]}"; do
|
||||
REPO_NAME=$(basename "$REPO_URL" .git)
|
||||
REPO_DIR="/workspace/$REPO_NAME"
|
||||
|
||||
echo "Repository: $GITHUB_REPO"
|
||||
echo "Target directory: $WORKSPACE_DIR"
|
||||
echo "Repository: $REPO_URL"
|
||||
echo "Target directory: $REPO_DIR"
|
||||
|
||||
# Check if repo already exists
|
||||
if [ -d "$WORKSPACE_DIR/.git" ]; then
|
||||
echo "Repository already exists, pulling latest changes..."
|
||||
cd "$WORKSPACE_DIR"
|
||||
git pull || echo "Pull failed, continuing anyway..."
|
||||
else
|
||||
echo "Cloning repository..."
|
||||
mkdir -p "$(dirname "$WORKSPACE_DIR")"
|
||||
|
||||
# Clone with token if provided
|
||||
if [ -n "$GITHUB_TOKEN" ]; then
|
||||
# Replace https://github.com/ with https://oauth2:token@github.com/
|
||||
CLONE_URL=$(echo "$GITHUB_REPO" | sed "s|https://github.com/|https://oauth2:${GITHUB_TOKEN}@github.com/|")
|
||||
git clone "$CLONE_URL" "$WORKSPACE_DIR"
|
||||
if [ -d "$REPO_DIR/.git" ]; then
|
||||
echo "Repository already exists, pulling latest changes..."
|
||||
cd "$REPO_DIR"
|
||||
git pull || echo "Pull failed, continuing anyway..."
|
||||
else
|
||||
git clone "$GITHUB_REPO" "$WORKSPACE_DIR"
|
||||
echo "Cloning repository..."
|
||||
mkdir -p "$(dirname "$REPO_DIR")"
|
||||
|
||||
if [ -n "$GITHUB_TOKEN" ]; then
|
||||
CLONE_URL=$(echo "$REPO_URL" | sed "s|https://github.com/|https://oauth2:${GITHUB_TOKEN}@github.com/|")
|
||||
git clone "$CLONE_URL" "$REPO_DIR"
|
||||
else
|
||||
git clone "$REPO_URL" "$REPO_DIR"
|
||||
fi
|
||||
fi
|
||||
|
||||
CLONED_DIRS+=("$REPO_DIR")
|
||||
done
|
||||
|
||||
if [ ${#CLONED_DIRS[@]} -eq 1 ]; then
|
||||
# Single repo — open directory directly (same as legacy behavior)
|
||||
WORKSPACE_DIR="${CLONED_DIRS[0]}"
|
||||
else
|
||||
# Multiple repos — generate a multi-root workspace file
|
||||
WS_FILE="/workspace/workspace.code-workspace"
|
||||
printf '{\n "folders": [\n' > "$WS_FILE"
|
||||
for i in "${!CLONED_DIRS[@]}"; do
|
||||
printf ' {"path": "%s"}' "${CLONED_DIRS[$i]}" >> "$WS_FILE"
|
||||
if [ "$i" -lt $(( ${#CLONED_DIRS[@]} - 1 )) ]; then
|
||||
printf ',\n' >> "$WS_FILE"
|
||||
else
|
||||
printf '\n' >> "$WS_FILE"
|
||||
fi
|
||||
done
|
||||
printf ' ],\n "settings": {}\n}\n' >> "$WS_FILE"
|
||||
WORKSPACE_DIR="$WS_FILE"
|
||||
echo "Generated multi-root workspace: $WS_FILE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set ownership using numeric IDs (username may not exist yet in baseimage-gui)
|
||||
RUN_UID="${USER_ID:-1000}"
|
||||
RUN_GID="${GROUP_ID:-1000}"
|
||||
chown -R "$RUN_UID:$RUN_GID" "$WORKSPACE_DIR"
|
||||
for dir in "${CLONED_DIRS[@]}"; do
|
||||
chown -R "$RUN_UID:$RUN_GID" "$dir"
|
||||
done
|
||||
if [ -n "$WS_FILE" ] && [ -f "$WS_FILE" ]; then
|
||||
chown "$RUN_UID:$RUN_GID" "$WS_FILE"
|
||||
fi
|
||||
# Ensure default workspace dir ownership if no repos were cloned
|
||||
if [ ${#REPOS[@]} -eq 0 ]; then
|
||||
chown -R "$RUN_UID:$RUN_GID" "$WORKSPACE_DIR"
|
||||
fi
|
||||
|
||||
# Ensure home directory exists on the PVC (may be absent on a fresh volume)
|
||||
mkdir -p "$HOME"
|
||||
chown "$RUN_UID:$RUN_GID" "$HOME"
|
||||
|
||||
# Seed Claude Code settings if missing (disable auto-updater in Docker)
|
||||
if [ ! -f "$HOME/.claude/settings.json" ]; then
|
||||
mkdir -p "$HOME/.claude"
|
||||
echo '{"env":{"DISABLE_AUTOUPDATER":"1"}}' > "$HOME/.claude/settings.json"
|
||||
chown -R "$RUN_UID:$RUN_GID" "$HOME/.claude"
|
||||
fi
|
||||
|
||||
# Export workspace directory for startapp.sh
|
||||
echo "$WORKSPACE_DIR" > /tmp/workspace-dir
|
||||
|
||||
Reference in New Issue
Block a user