One container with everything you need for Web3 dev: Solidity, Go, Rust, Solana. Works on Windows, macOS, Linux. No local installs, no WSL headaches.
| Tool | Version |
|---|---|
| Foundry (forge, cast, anvil) | latest stable |
| Go | 1.23.4 |
| Rust | stable |
| Solana CLI | 1.18.26 |
| Anchor | 0.30.1 |
| Node | 20.x |
Versions are pinned via ARG in the Dockerfile so you can bump any of them without touching the rest of the file.
You need Docker Desktop (Windows/macOS) or Docker Engine (Linux). That's it.
Copy the files into your project root, then:
cp .env.example .env
# fill in your keys
make up # builds the image on first run (~5-10 min), then starts
make shell # get a shell inside the containerFrom there, forge, go, rustc, anchor, solana are all on PATH.
Never commit .env. Use a dedicated dev wallet for PRIVATE_KEY, not your main one.
make up # start
make shell # open a shell
make down # stop
make logs # follow logs
make rebuild # full rebuild after Dockerfile changes
make clean # nuclear option, see belowInstall the Dev Containers extension. Open your project, then Ctrl+Shift+P > "Dev Containers: Reopen in Container". Your editor runs inside the container with full IntelliSense.
docker compose build --build-arg GO_VERSION=1.23.5
docker compose build --build-arg ANCHOR_VERSION=0.31.0Node comes from NodeSource, not apt. Ubuntu 22.04's apt ships Node 12. Anchor tests need Node 18+.
Anchor is installed from crates.io, not --git. Building from the GitHub source takes 30-40 minutes per image build. The published crate takes 2-3 minutes. There's no real downside unless you need an unreleased commit.
Three separate Cargo volumes. ~/.cargo/registry for published crates, ~/.cargo/git for git-sourced deps (some Anchor deps still come from GitHub), and ~/.foundry for Forge binaries. Skip any of these and you're re-downloading on every rebuild.
restart: unless-stopped in docker-compose. The container comes back up after a reboot without you having to remember to run make up.
make cleanThis removes all Docker containers, images, volumes and build cache on your machine, not just this project's. Don't run it if you have unrelated Docker stuff you care about.
Foundry fork test:
forge init my-project && cd my-project
forge test --fork-url $ALCHEMY_MAINNET_RPC --fork-block-number 19000000Anchor program:
anchor init my-program && cd my-program
anchor build && anchor test
solana config set --url devnet && solana airdrop 2 && anchor deploygo-ethereum indexer:
mkdir go-indexer && cd go-indexer
go mod init github.com/yourname/go-indexer
go get github.com/ethereum/go-ethereumMIT license.
