FROM node:24
RUN npm install -g @google/gemini-cli --ignore-scripts
USER node
WORKDIR /home/nodedocker buildx build -t docker-gemini-setup .docker run --name setup -it docker-gemini-setup bashNOTE 1:
This login method is for using the google-cli with a free license that uses a Google account. Please note that the free license is used for training AI models.
NOTE 2:
Since gemini-cli can also execute commands, using a Google account linked to other services might cause it to unintentionally access those services. Therefore, it is better to create a new, dedicated Google account for authentication.
- https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/authentication.md
- https://github.com/google-gemini/gemini-cli/blob/main/docs/tos-privacy.md
node@containerid:/# gemini
(Select `Login with Google` as the authentication method.)
(Since gemini-cli will terminate temporarily, restart it again.)
node@containerid:/# gemini
(Open the displayed URL in your local browser and allow gemini-cli to use your Google account.)
(Copy and paste the key displayed in the browser into the prompt where gemini-cli is waiting for input.)
(Once authentication is successful, gemini-cli will be available for use.)On a different terminal, create a Docker image from the current container's state.
docker commit setup docker-gemini:latestAfter exiting the Docker container, delete the container used for setup.
docker rm setupFROM docker-gemini
USER root
RUN apt-get update -yq && apt-get install -yq curl build-essential
USER node
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/home/node/.cargo/bin:$PATH"
RUN cargo install cargo-llvm-cov && \
cargo install cargo-msrv --locked
WORKDIR /home/node/workspacedocker buildx build -f Dockerfile_rust -t docker-gemini-rust .docker run --name gemini-rust -v ./:/home/node/workspace -it docker-gemini-rust bashFROM docker-gemini
USER root
RUN apt-get update -yq && apt-get install -yq curl build-essential
RUN curl -OL https://go.dev/dl/go1.25.1.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.25.1.linux-amd64.tar.gz
USER node
ENV PATH="/usr/local/go/bin:$PATH"
WORKDIR /home/node/workspacedocker buildx build -f Dockerfile_go -t docker-gemini-go .docker run --name gemini-go -v ./:/home/node/workspace -it docker-gemini-go bashFROM docker-gemini
USER root
RUN apt-get update -yq && apt-get install -yq curl build-essential
USER node
WORKDIR /home/node
RUN curl -OL https://download.oracle.com/graalvm/25/latest/graalvm-jdk-25_linux-x64_bin.tar.gz && \
tar -xzf graalvm-jdk-25_linux-x64_bin.tar.gz
ENV PATH=/home/node/graalvm-jdk-25+37.1/bin:$PATH
WORKDIR /home/node/workspacedocker buildx build -f Dockerfile_java -t docker-gemini-java .docker run --name gemini-java -v ./:/home/node/workspace -it docker-gemini-java bash