This repository provides a ready-to-use Docker image encapsulating the Google Gemini Command Line Interface (CLI). The primary intention is to establish a consistent, isolated, and portable environment for interacting with the Gemini API.
Using this container image allows you to:
- Avoid Local Dependency Hassle: Run the Gemini CLI without installing Python, the
google-genaiSDK, and all dependencies directly on your host machine. - Ensure Version Consistency: Lock in a specific, tested version of the Gemini CLI, guaranteeing reproducible results across different projects and environments.
- Simplify Setup: Get up and running with a single
podman runcommand, ideal for rapid prototyping, CI/CD pipelines, and project baselines. - Manage API Key Securely: Easily pass your sensitive GEMINI_API_KEY to the container using standard Docker environment variables.
Follow these steps to quickly execute Gemini CLI commands using the Docker image.
You must have Podman installed on your system.
podman build -t [YOUR_CONTAINER_IMAGE_NAME]The Gemini CLI requires your API key. For security, it's best practice to pass this as an environment variable (-e flag) during the Docker run.
Note: Replace
YOUR_GEMINI_API_KEYand[YOUR_CONTAINER_IMAGE_NAME](or the custom tag you build) with the correct values.
Use the following command structure to execute any Gemini CLI command inside the container.
podman run -it \
-e GEMINI_API_KEY="YOUR_GEMINI_API_KEY" \
-v "$(pwd)":/home/aidev/workspace \
[YOUR_DOCKER_IMAGE_NAME] \
/bin/bash