Command
Description
Builds your agent into a production-ready Docker image. This packages your agent code, dependencies, and runtime into a container for deployment.Usage
Build from youragent/ directory:
Expected Output
What Gets Built
The build process:- Generates Dockerfile - Creates
.sb0/Dockerfile.agentbased on your config - Installs system packages - From
agent.config.yaml - Installs Python dependencies - From
pyproject.tomlanduv.lock - Copies agent code - Your
handle_query.pyand other files - Packages sb0 runtime - Includes sb0-runner and sb0-protocol
- Creates Docker image - Tagged according to
agent.config.yaml
Image Name
The image name is defined in youragent.config.yaml:
.dockerignore Warning
If.dockerignore is missing, you’ll see a warning:
.dockerignore file:
When to Build
You need to build when:- Deploying to production - Before running
sb0 push - Configuration changes - After modifying
agent.config.yaml - System package changes - After adding to
system_packages - Final testing - To verify Docker image works correctly
- Local testing - Use
sb0 run --promptinstead - Python code changes - Test with
sb0 runwithout rebuilding - Adding Python dependencies - Test locally first, build when ready to deploy
Build Platforms
Builds for your native platform by default:- Apple Silicon (M1/M2/M3) -
linux/arm64 - Intel/AMD -
linux/amd64
Requirements
- Docker must be running - Start Docker Desktop or Docker daemon
- Must run from agent directory - The directory containing
agent.config.yaml - Valid configuration -
agent.config.yamlmust be properly formatted
Common Issues
Docker Not Running
Invalid Configuration
agent.config.yaml and try again.
Generated Files
Building creates:.sb0/Dockerfile.agent- Generated Dockerfile (don’t edit manually)- Docker image - Tagged according to your config
The
.sb0/Dockerfile.agent is automatically generated. Don’t edit it manually—your changes will be overwritten on the next build.Next Steps
After building:-
Test the image locally (optional):
-
Deploy to platform: