Devcontainer
This repo includes a devcontainer configuration at .devcontainer/devcontainer.json that provides a fully configured development environment with Go, Task, and all required tools preinstalled. It works with VS Code, GitHub Codespaces, Zed, and Factory Droid Computers.
What it provides
- Go 1.26 (pinned via
mcr.microsoft.com/devcontainers/go:2-1.26-bookworm) - Task (installed via the go-task devcontainer feature)
- Automatic Go version sync — if the image's Go patch version doesn't match
go.mod, it is upgraded automatically during container creation. The official SHA256 is fetched from Go's release feed and verified before the old toolchain is removed, so a failed download never leaves the container without Go - One-command bootstrap —
task bootstrapruns automatically, installing all development tools (golangci-lint, goreleaser, jscpd, lefthook), setting up git hooks, and building the CLI - uv (installed via the uv devcontainer feature) — enables
task docs-servefor local documentation preview with MkDocs - Docker (installed via the docker-outside-of-docker feature) — enables
task copyrightwhich runsdocker runfor Apache Skywalking Eyes license header management - GitHub CLI (installed via the github-cli feature) — enables
ghcommands for fork management, PR creation, and review from inside the container
Local development
VS Code
- Install the Dev Containers extension
- Open the cloned repo in VS Code
- When prompted, click Reopen in Container (or run the command via
Cmd+Shift+P> "Dev Containers: Reopen in Container")
VS Code rebuilds the container and runs all lifecycle commands. The terminal is available once postCreateCommand completes.
Zed
- Open the cloned repo in Zed
- When prompted, click Open in Container
- If you modify
.devcontainer/devcontainer.json, Zed does not auto-rebuild. Kill the container manually and reconnect: Then use Project: Open Remote in the command palette to reconnect.
Devcontainer CLI (no IDE)
# Build and start the container
npx @devcontainers/cli up --workspace-folder .
# Get a shell inside
npx @devcontainers/cli exec --workspace-folder . bash
Add --remove-existing-container to force a full rebuild after changing devcontainer.json.
GitHub Codespaces
- Go to the repo on GitHub
- Click Code > Codespaces > Create codespace on main
- Codespaces reads
.devcontainer/devcontainer.jsonautomatically and provisions the environment
The devcontainer works with Codespaces out of the box — no additional configuration needed.
Factory Droid Computers
Droid Computers are persistent cloud compute environments that Factory can connect to across sessions. To use this repo with a Droid Computer:
- Create a managed Droid Computer in Settings > Droid Computers (Factory provisions an Ubuntu environment)
- Clone the repo inside the Droid Computer:
- Run bootstrap:
For BYOM (Bring Your Own Machine) Droid Computers, the devcontainer is optional — the machine's existing toolchain is used directly. See the BYOM docs for setup.
To run larger Factory Missions on a Droid Computer, the persistent environment means the Go toolchain only needs to be installed once. Subsequent sessions reuse the same installed packages, built binary, and configuration.
Lifecycle commands
The devcontainer uses three lifecycle hooks that run in order during container creation:
| Hook | Command | Purpose |
|---|---|---|
updateContentCommand |
bash .devcontainer/sync-go.sh |
Upgrades Go to match go.mod if the image version differs |
postCreateCommand |
task bootstrap |
Installs tools, sets up git hooks, builds the CLI |
waitFor |
postCreateCommand |
Tools wait for bootstrap to finish before connecting |
The waitFor property ensures the terminal is not available until all setup is complete.
Troubleshooting
Go version mismatch
The image may ship a slightly older Go patch version than go.mod requires. The sync-go.sh script handles this automatically by downloading and installing the exact version from go.dev. If you see a version mismatch error, verify the script ran:
Task not found
Task is installed via the ghcr.io/eitsupi/devcontainer-features/go-task:1 feature during the Docker build. If Task is missing, the feature may have failed. Install it manually:
Container not picking up config changes
After editing devcontainer.json, you must rebuild the container. In VS Code, use "Dev Containers: Rebuild Container". With the CLI:
Bare-repo worktrees
The devcontainer mounts a single directory and expects a standard git clone. Bare-repo worktree layouts (where .git is a file pointing to an external bare repo) will not work because the gitdir reference resolves to a host path that doesn't exist inside the container. Use a normal clone for devcontainer-based development.