|
1 | 1 | # Gemini CLI Container<!-- omit from toc --> |
2 | 2 |
|
3 | 3 | - [Container Architecture](#container-architecture) |
4 | | - - [Structure of `Dockerfile`](#structure-of-dockerfile) |
5 | | - - [Security Features](#security-features) |
6 | 4 | - [Building the Container Image](#building-the-container-image) |
7 | 5 | - [Build Arguments](#build-arguments) |
8 | 6 | - [Authentication Setup](#authentication-setup) |
|
30 | 28 | - [File Access Issues](#file-access-issues) |
31 | 29 | - [Container Issues](#container-issues) |
32 | 30 |
|
33 | | -A containerized version of Google's Gemini CLI tool, built with security and |
34 | | -portability in mind. This container provides a rootless, distroless environment |
35 | | -for running Gemini CLI commands while maintaining persistent authentication and |
36 | | -seamless file access. |
| 31 | +A containerized version of Google's Gemini CLI tool. This container provides a rootless environment |
| 32 | +for running Gemini CLI commands while maintaining persistent authentication and seamless file access. |
37 | 33 |
|
38 | 34 | ## Container Architecture |
39 | 35 |
|
40 | | -### Structure of `Dockerfile` |
41 | | - |
42 | | -This container uses a multi-stage build process for optimal security and size: |
43 | | - |
44 | | -- **Stage 1 (Builder)**: Uses `node:20-slim` to install the `@google/gemini-cli` package |
45 | | -- **Stage 2 (OS Prep)**: Uses `debian:stable-slim` to prepare user configuration files |
46 | | -- **Final Stage**: Uses `gcr.io/distroless/nodejs20-debian12:nonroot` for a minimal, secure runtime |
47 | | - |
48 | | -### Security Features |
49 | | - |
50 | 36 | - **Rootless execution**: Runs as user `gemini` (UID 1000) instead of root |
51 | | -- **Distroless base**: Minimal attack surface with no shell or package managers |
52 | | -- **Non-privileged user**: Enhanced security through principle of least privilege |
| 37 | +- **Minimal base**: Uses `node:22-slim` which provides a smaller attack surface |
53 | 38 |
|
54 | 39 | ## Building the Container Image |
55 | 40 |
|
@@ -103,6 +88,7 @@ To verify your authentication is working: |
103 | 88 | ```bash |
104 | 89 | docker run -it -v $HOME:/home/gemini --rm gemini-cli:dev --help |
105 | 90 | ``` |
| 91 | + |
106 | 92 | If authentication is successful, you should see the Gemini CLI help without authentication prompts. |
107 | 93 |
|
108 | 94 | ### Authentication via GEMINI_API_KEY |
|
0 commit comments