mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-25 05:21:03 -07:00
2.0 KiB
2.0 KiB
Detailed Design: Workspace Container Image
1. Introduction
The Workspace Container Image defines the standardized software environment for all remote execution. It is pre-built and optimized for fast startup on GCE instances.
2. Dockerfile Specification
The image is maintained in packages/workspace-manager/docker/Dockerfile.
- Base:
node:20-slim - Environment:
GEMINI_CLI_WORKSPACE=1DEBIAN_FRONTEND=noninteractive
- Tools:
git,rsync,curl,vim,tmux,shpool.gh(GitHub CLI).google-cloud-sdk(via apt-get).- Pre-compiled
gemini-clibinary.
- User:
node(UID 1000) for unprivileged execution.
3. Image Contents & Pre-loading
- The
gemini-clinightly binary is pre-loaded into/usr/local/bin/gemini. - Standard node dependencies (
npm,yarn,pnpm) are pre-installed. shpoolis used as the primary process manager to allow terminal detachment and re-attachment.
4. Entrypoint Strategy (entrypoint.sh)
When the container starts on GCE:
- Secret Injection: Reads the GitHub PAT from a memory-only mount
(
/dev/shm/github_token) and authenticatesgh. - Settings Restore: Syncs the user's
~/.gemini/configuration (aliased from/home/node/.gemini_volume). - Persistence Layer: Starts
shpooldaemon in the background. - Ready Signal: Notifies the Workspace Hub that the environment is ready for connection.
5. Storage Strategy
- System: The container image itself is ephemeral.
- User Home: A persistent GCE Disk (PD) is mounted at
/home/node. This ensures:~/.geminisettings persist.- Cloned git repositories persist between workspace restarts.
npm installartifacts (node_modules) persist.
6. Build & Release
- The image is automatically built and pushed to the Hub's Artifact Registry on
every
mainpush or newnightlytag. - The Hub API defaults to using the
latestornightlytag unless specified otherwise.