Custom images apply to Linux Devboxes. macOS Devboxes run from a Namespace-managed base image, where you select the macOS and Xcode version instead. See macOS.
Dockerfile
Use a standard Dockerfile to define your development environment. Install the tools, runtimes, and dependencies your workflow needs.Why Dockerfiles?
Using Dockerfiles for base images provides:- Familiarity: Use the same syntax you already know
- Version control: Check your environment definition into git alongside your code
- Flexibility: Install any software, configure any tools, customize any settings
- Portability: Share consistent environments across your entire team
Building an Image
The argument todevbox image build is the build context directory. By default, it looks for a Dockerfile in that directory.
--name is required. Use a descriptive name like my-team/golang or frontend/node20. The image is published to your workspace and available immediately.
Use -f to point to a Dockerfile in a different location. This is useful in a monorepo where the Dockerfile lives in a subdirectory but you need the full repo as context:
.dockerignore to keep the upload small.
Run devbox image build -h for additional options.
Optimization
After a build completes, Namespace converts the container image into an optimized disk format. This is what allows Devboxes to boot in seconds rather than pulling and unpacking a container image on every start. Optimization runs automatically and typically takes a few minutes. You can track its progress in the CLI output and in the Images dashboard.Creating a Devbox from Your Image
Once your image is built, create Devboxes from it. Via the CLI:Managing Images
Listing Images
Updating an Image
Rebuild with the same--name to publish a new version. New Devboxes will use the latest version; existing Devboxes continue using the version they were created with.
Expiring an Image
Expire an image to prevent new Devboxes from using it:Nested Virtualization
Linux Devboxes support nested virtualization:/dev/kvm is available inside the Devbox, so processes can use hardware-assisted virtualization. No flag or spec file option is needed. The device is mounted automatically, and its permissions are set so non-root users can use it without additional setup.
This works the same way with custom images. You don’t need to do anything in your Dockerfile to make /dev/kvm available.
To verify it’s present, run:
linux/amd64. See Android Emulators for more information.
Nested virtualization is not available on macOS Devboxes. See Nested Virtualization for full platform support details.
Next Steps
Remote Development
SSH access and SSH config for a Devbox.
Devbox Lifecycle
Listing, starting, stopping, idleness, and deleting.
Sessions
Persistent terminal sessions that survive disconnections and Devbox restarts.