Skip to content

L0RD-ZER0/Antigravity-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antigravity-Docker

Antigravity IDE in a Docker Container with GUI and Audio Forwarding for WSL2 (and Linux if you want) for people who are just as paranoid as me about running some proprietary AI IDE on their host machine because you have a lot of sensitive credentials and data in your local environment which you don't want to risk exposing no matter what, while also enjoying a hands-off experience of automated agents and loops that run in parallel and assist with boring work.

Containerized Antigravity IDE — with GUI, audio, and seamless filesystem integration.
Works out of the box on WSL2 (default) and Linux hosts.

Note

Although the project sandboxes Antigravity IDE, it does not sandbox the agentic hub, or any other related components outside of IDE. It is intended for users who want to run the IDE in a containerized environment.


Overview

This project builds a Docker image that runs the full Antigravity IDE desktop application inside a container, forwarding display (X11 / Wayland) and audio (PulseAudio) to the host. It is primarily designed for WSL2 on Windows using WSLg, but can be trivially adapted for any Linux distribution.

Table of Contents

What's Inside the Container

Component Detail
Base OS Ubuntu (latest LTS)
Antigravity IDE Latest release fetched automatically from antigravity-nix
Browser Google Chrome (stable)
Developer Tools neovim, git, jq, ripgrep, htop, curl, gpg
User Non‑root antigravity user with passwordless sudo
Shared Memory 4 GB (--shm-size=4g)

Credits & Attribution

This project would not exist without the work of others:

  • jacopone / antigravity-nix — provides the automated version-tracking and download mechanism for Antigravity IDE releases. The Dockerfile relies on versions.json from this repository to always fetch the latest IDE build. This project would've taken long enough I'd just move to OpenCode instead if it weren't for this handy tool.
  • Antigravity IDE — the original editor. All copyright and trademarks belong to its respective owners / Google / the Antigravity IDE team. This project is not affiliated with or endorsed by the Antigravity IDE developers. It is a simple sandboxing recipe for the IDE, and IDE alone. The agentic hub is not included.
  • The Docker build recipe and wrapper scripts in this repository are a thin infrastructure layer on top of the above projects.

Why ever to use Antigravity IDE or Gemini of all things?

So far Antigravity IDE is the only thing which provides a seamless experience of running a Chrome browser + DevTools MCP feedback loop with pretty much zero configuration outside of clicking buttons to install the MCP extension itself. Add to that it supports using both Anthropic models for general correctness and Gemini for visual or quick tasks and chores, and the experience is decent enough to make use of a Google AI Pro plan to get some actual work done, while also enjoying the benefits it brings in terms of Google Drive, general Gemini Search / Deep Research / Nano Banana and other related promotional offers. Provided you are ok with extensions sometimes not working.

Goal here is for max convenience and minimal time spent, while also keeping a sandbox, bind mounting on host, and not having to install anything on the host machine. The container is a self-contained environment that can be easily rebuilt or updated without affecting the host system. If you have any ideas for improvements, feel free to open an issue or a pull request. I'll be more than happy to review and debate them.

It is not the goal here to find the most cracked way of using AI or Antigravity for that matter.


Prerequisites

WSL2 (Windows — default target)

  • Windows 11 (recommended) or Windows 10 build 22000+
  • Docker Desktop with the WSL2 backend enabled
  • WSLg — pre-installed on recent Windows 11 builds; provides X11/Wayland/PulseAudio out of the box
  • Ensure your WSL distribution has systemd enabled

Linux (alternative target)

  • A Linux distribution with:
    • Docker (or Podman with Docker compatibility)
    • An X11 or Wayland display server
    • PulseAudio (for audio forwarding, optional)

Usage

1. Build the image

./BUILD.sh

This cleans up any existing antigravity-docker container and builds a fresh image.

Under the hood
docker rm -f antigravity-docker
docker build -f Antigravity.Dockerfile -t antigravity-docker .

2. Run the container

./AGI.sh

By default this starts the container with sleep infinity, keeping it alive for you to attach to. Uncomment the antigravity-ide --wait --verbose command at the end of AGI.sh to launch the IDE directly.


OAuth / Sign-In

Antigravity IDE uses OAuth via Google. There are two ways to handle this inside the container.

Option 1 — Log in inside the container (simple)

Open Google Chrome inside the container and sign into your Google account there. Then launch Antigravity IDE and authenticate normally. Everything stays inside the container.

Option 2 — Paranoid mode (no Google login inside the container)

This method keeps your Google credentials entirely on the host machine's / some other machine's browser.

  1. Launch Antigravity IDE in the container. It will open an OAuth page in Chrome.
  2. Copy the URL from Chrome's address bar in the container.
  3. Open that URL in your host machine's browser (where you're already logged into Google).
  4. Type anything in the prompted input field and press Enter. An error will appear saying something went wrong and you need to restart/reload the process. Do so.
  5. Now sign in normally via Google. The OAuth flow will redirect to localhost:<some-random-port>/....
  6. Copy that localhost:<some-random-port> URL (complete url with everything) and paste it into Chrome inside the container, then press Enter.
  7. Wait a moment. The IDE should activate.

Note: Chrome inside the container is convenient for this because you can also run Chrome DevTools MCP alongside it, making development much easier. If you choose not to use Chrome, the redirect URL can still be found in the IDE's debug logs, but it's far less convenient to dig out.


Platform Guides

WSL2 (default)

AGI.sh is pre-configured for WSL2 with WSLg. Mount paths use the /mnt/c/... WSL convention:

Variable Default Purpose
WS_DIR /mnt/c/Users/Zero/Codeworks/Antigravity Your project workspace → mounted at /workspace
CNF_DIR /mnt/c/Users/Zero/Codeworks/Antigravity-Config IDE configuration → mounted at /root/.antigravity

Things to check before running

  1. User UID — the container user is created with UID=1002. If your WSL user has a different UID, change USER_UID in Antigravity.Dockerfile (and match it in XDG_RUNTIME_DIR in AGI.sh).
  2. XDG_RUNTIME_DIR — verify your actual runtime directory path: ls /run/user/ inside WSL. Update /run/user/1002 if different.
  3. Mount paths — update WS_DIR and CNF_DIR to point to your workspace and config directories.

Linux

To run on a native Linux host, create a runner script (e.g. AGI-linux.sh):

#!/usr/bin/env bash

CNF_DIR="$HOME/.config/antigravity"
WS_DIR="$HOME/Projects/MyAntigravityProject"

docker rm -f antigravity-docker

docker run \
  --security-opt seccomp=unconfined \
  --cap-add=SYS_ADMIN \
  --network host \
  -e DISPLAY="$DISPLAY" \
  -e WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \
  -e XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
  -e PULSE_SERVER="$PULSE_SERVER" \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR" \
  -v "$WS_DIR:/workspace" \
  -v "$CNF_DIR:/root/.antigravity" \
  --shm-size=4g \
  --name antigravity-docker \
  antigravity-docker

Key differences from WSL2:

  • Use --network host instead of forwarding individual sockets (simpler on Linux)
  • No /mnt/wslg bind mount
  • No /mnt/c/... paths; use native $HOME paths
  • XDG_RUNTIME_DIR is typically /run/user/$(id -u)

Customization Guide

Changing the user UID / GID

If your host user's UID is not 1002, edit the build args in Antigravity.Dockerfile:

ARG USER_UID=1000
ARG USER_GID=$USER_UID

Then also update the runtime XDG_RUNTIME_DIR in AGI.sh.

Adding more tools to the image

Extend the apt install line in Antigravity.Dockerfile:

apt install -y neovim curl gpg git htop jq ripgrep sudo <your-packages-here>... 

Changing the workspace / config paths

Edit the variables at the top of AGI.sh:

WS_DIR='/mnt/c/Users/YOU/Codeworks/YourProject'
CNF_DIR='/mnt/c/Users/YOU/Codeworks/YourConfig'

Pinning a specific Antigravity IDE version

Currently the image always fetches the latest version via the antigravity-nix versions.json. To pin a version, replace the RUN step in Antigravity.Dockerfile with a direct download URL for a .tar.gz release.

Disabling Chrome

Remove the Chrome installation lines in Antigravity.Dockerfile:

# curl -o /root/chrome.deb ...
# apt install -y /root/chrome.deb
# rm /root/chrome.deb

File Reference

File Purpose
Antigravity.Dockerfile Docker image definition — installs Ubuntu, Antigravity IDE, Chrome, and dev tools
BUILD.sh Build script — removes old container and builds a fresh image
AGI.sh WSL2 run script — starts the container with GUI/audio forwarding
.gitignore Ignores IDE and OS metadata files

License

Antigravity IDE

Antigravity IDE is a proprietary / third-party editor. All rights, copyright, and trademarks belong to its original authors. This project is not affiliated with or endorsed by the Antigravity IDE developers. The IDE is fetched from its official distribution channels and is subject to its own license terms.

Build Recipe & Scripts

The Dockerfile, shell scripts, and documentation in this repository — i.e., the build recipe — are provided under the terms of the MIT License. It is in no way a license for the Antigravity IDE itself, or affiliated with its authors in any way.

MIT License

Copyright (c) 2026 L0RD-ZER0

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

A copy of this license is included in the repository at LICENSE.md.

In short: Use the build recipe freely — build it, modify it, share it. The Antigravity IDE binary itself carries its own license; refer to the official website for its terms.

About

A general sandboxing recipe for Google Antigravity.

Topics

Resources

License

Stars

Watchers

Forks

Contributors