This folder contains the files necessary to build and run a highly opinionated Docker container, designed to get a developer up and running with Antigravity in a sandbox instantly.
Below are step-by-step instructions for getting started.
Important Platform Note: Flutter does not fully support
linux/arm64yet. If you are on an Apple Silicon (M1/M2/M3) machine, you must set the platform tolinux/amd64when building and running.
podman build -t flutter_docker .
podman build --platform linux/amd64 -t flutter_docker .
You can override the default Flutter version using the FLUTTER_VERSION build argument.
podman build --platform linux/amd64 --build-arg FLUTTER_VERSION=3.45.0 -t flutter_docker:3.45.0 .
You can run the container in any project folder. The current working directory ($PWD) will be mapped to /app inside the container.
podman run --userns=keep-id:uid=1000,gid=1000 -it \ -v ".:/app:z" \ -v "dart_tool_cache:/app/.dart_tool" \ -v "dart_build_cache:/app/build" \ -v "$USER/.gemini:/home/coder/.gemini:z" \ flutter_docker:latest
podman run --platform linux/amd64 --userns=keep-id:uid=1000,gid=1000 -it \ -v "${PWD}:/app:z" \ -v "dart_tool_cache:/app/.dart_tool" \ -v "dart_build_cache:/app/build" \ -v "$USER/.gemini:/home/coder/.gemini:z" \ flutter_docker:latest
If you are a member of the Flutter staff, you can pull the image directly from the Google Cloud registry without building it locally.
gcloud auth login gcloud config set project flutter-infra gcloud auth configure-docker us-docker.pkg.dev podman pull us-docker.pkg.dev/flutter-infra/flutter-infra/flutter_docker:latest
For a more convenient workflow, you can set up docker-compose.yml and shell aliases to easily start and attach to background containers.
docker-compose.ymlCreate the destination directory if it doesn't exist, and copy the compose file there:
mkdir -p ~/.config/coder-env cp docker-compose.yml ~/.config/coder-env/
Copy the contents of functions.sh into your ~/.bashrc or ~/.zshrc:
cat functions.sh >> ~/.zshrc source ~/.zshrc
(Use ~/.bashrc if you are using Bash)
Once configured, you can use these shortcuts in any project folder:
coder-up: Starts the development environment in the background.coder-attach: Attaches to the active tmux session in the container.coder-down: Stops and tears down the container.If you are running the Docker/Podman container on a remote machine, you can connect to the internal tmux session directly using SSH:
ssh -t <user>@<hostname> "podman exec -it -t <container-name> tmux attach"
You can use Visual Studio Code to connect directly to the running container, whether it's running locally or remotely.
Install the following extensions in VS Code:
ms-vscode-remote.remote-containers)ms-vscode-remote.remote-ssh) (required for remote connections)coder-up).Ctrl+Shift+P / Cmd+Shift+P).flutter_docker container from the list.<user>@<hostname>.When using Git worktrees with this container, you must configure Git to use relative paths. Failure to do so will result in broken worktree references because absolute paths differ between your host machine and the container.
To configure Git to use relative paths, run the following command on your host machine (not inside the container) from within your Git repository:
git config --global worktree.useRelativePaths true && git worktree repair
After repairing, ensure you run podman run (or coder-up) from the root of the worktree so that the container mounts the correct paths.