Skip to content

Instantly share code, notes, and snippets.

@sttk
Last active May 24, 2026 10:52
Show Gist options
  • Select an option

  • Save sttk/360c3f7a025bf7f1163333d222c087ac to your computer and use it in GitHub Desktop.

Select an option

Save sttk/360c3f7a025bf7f1163333d222c087ac to your computer and use it in GitHub Desktop.

Antigravity CLI on docker container

1. Build a docker image for antigravity-cli

1.1. Install antigravity-cli

FROM ubuntu:26.04

RUN apt-get -yq update && apt-get install -yq curl

ENV TERM=xterm-256color

USER ubuntu

WORKDIR /home/ubuntu

RUN curl -fsSL https://antigravity.google/cli/install.sh | bash
docker buildx build -t docker-antigravity-setup .
docker run --name setup -it docker-antigravity-setup bash

1.2. Login google for antigravity-cli

ubuntu@2c717f9ceac3:~$ agy
---(authentication)
(Select `1. Google OAuth` as the login method.)
(Open the displayed URL in your local browser and allow antigravity-cli to use your Google account.)
(Copy and paste the key displayed in the browser into the prompt where antigravity-cli is waiting for input.)
(Once authentication is successful, antigravity-cli will be available for use.)
---(color scheme)
(Select your favorite color scheme.)
---(agreement of terms of service and data use)
(Select [Done].)
---(Trust of the current folder: /home/ubuntu)
(Select Yes.)
---(Exit session)
(Enter Ctrl+D twice.)

1.3. Save the current container state as a Docker image

On a different terminal, create a Docker image from the current container's state.

docker commit setup docker-antigravity:latest

After exiting the Docker container, delete the container used for setup.

docker rm setup

2. Create Rust development environment

2.1. Install Rust

FROM docker-antigravity

USER root

RUN apt-get update -yq && apt-get install -yq curl build-essential

USER ubuntu

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

ENV PATH="/home/ubuntu/.cargo/bin:$PATH"

RUN cargo install cargo-llvm-cov && \
    cargo install cargo-msrv --locked

WORKDIR /home/ubuntu/workspace
docker buildx build -f Dockerfile_rust -t docker-antigravity-rust .

2.2. Run docker-antigravity-rust with local directory synchronization

docker run --name antigravity-rust -v ./:/home/ubuntu/workspace -it docker-antigravity-rust bash

3. Create Golang development environment

3.1. Install Golang

FROM docker-antigravity

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 ubuntu

ENV PATH="/usr/local/go/bin:$PATH"

WORKDIR /home/ubuntu/workspace
docker buildx build -f Dockerfile_go -t docker-antigravity-go .

3.2. Run docker-antigravity-go with local directory synchronization

docker run --name antigravity-go -v ./:/home/ubuntu/workspace -it docker-antigravity-go bash

4. Create Java development environmet

4.1. Install Java

FROM docker-antigravity

USER root

RUN apt-get update -yq && apt-get install -yq curl build-essential

USER ubuntu

WORKDIR /home/ubuntu

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/ubuntu/graalvm-jdk-25+37.1/bin:$PATH

WORKDIR /home/ubuntu/workspace
docker buildx build -f Dockerfile_java -t docker-antigravity-java .

4.2. Run docker-antigravity-java with local directory synchronization

docker run --name antigravity-java -v ./:/home/ubuntu/workspace -it docker-antigravity-java bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment