Building & Attaching¶
How to build container images and work inside them.
Building Images¶
Basic Build¶
Build the container for the active workspace:
This will:
- Detect your app's language
- Generate a Dockerfile (if needed)
- Build the container image
- Install language tools and LSP servers
- Configure Neovim
Force Rebuild¶
Rebuild even if the image exists:
Build Without Cache¶
Start fresh without Docker cache:
What Gets Built?¶
dvm auto-detects your app and sets up:
| Language | Tools Installed |
|---|---|
| Go | go, gopls, golangci-lint |
| Python | python, pip, pyright, black |
| Node.js | node, npm, typescript-language-server |
| Rust | rust, cargo, rust-analyzer |
Plus common tools:
- Neovim with plugins
- git, curl, wget
- ripgrep, fd-find
- tmux
Attaching to Containers¶
Basic Attach¶
Enter the active workspace container:
Attach to Specific Workspace¶
What Happens on Attach?¶
- Container starts (if not running)
- App mounted at
/workspace - Terminal connects with full resize support
- You're inside! Ready to code
┌────────────────────────────────────────────────────┐
│ Your Terminal │
│ ┌──────────────────────────────────────────────┐ │
│ │ Container │ │
│ │ /workspace $ nvim . │ │
│ │ │ │
│ │ Your app files are here │ │
│ │ Changes sync automatically │ │
│ └──────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────┘
Working Inside the Container¶
Once attached:
# Your app is at /workspace
cd /workspace
ls
# Edit with Neovim (fully configured!)
nvim main.go
# Run your code
go run .
python main.py
npm start
# Use git
git status
git commit -m "feat: add feature"
# Exit when done
exit
# or Ctrl+D
Detaching¶
Exit the Container¶
Just type exit or press Ctrl+D.
Stop the Container¶
Stop the container from outside:
Or stop a specific workspace:
Auto-Recreate on Image Change¶
When you run dvm attach:
- dvm checks if the image has changed
- If yes, the container is recreated
- Your code is still there (it's mounted)
This means after dvm build --force, the next dvm attach will use the new image automatically.
Terminal Resize¶
The container terminal supports full resize:
- Resize your terminal window
- The container terminal adjusts automatically
- Works with Neovim splits, tmux, etc.
Container Platforms¶
dvm detects and uses available platforms:
| Platform | Status |
|---|---|
| OrbStack | Recommended for macOS |
| Docker Desktop | Cross-platform |
| Podman | Rootless option |
| Colima | Lightweight |
Force a Specific Platform¶
Troubleshooting¶
Image Not Building¶
# Check platform detection
dvm get plat
# Try verbose mode
dvm build -v
# Check logs
dvm build --log-file build.log
Container Won't Start¶
Changes Not Persisting¶
Your app is mounted, so changes should persist. If they don't:
- Make sure you're editing in
/workspace - Check that the mount is working:
ls /workspace
Next Steps¶
- Commands Reference - Full command list
- YAML Configuration - Customize workspaces
- nvp Plugins - Configure Neovim