Lab
Set Up Your Docker Sandbox Environment
30 min
Intermediate3 Free Attempts
Instructions
Objective
Create a docker-compose.yml file that sets up a complete Computer Use development environment with proper isolation, networking, and volume mounts.
Background
Running Computer Use agents directly on your system is risky. Docker provides isolation so the agent can't accidentally delete files or access sensitive data on your host machine.
Requirements
Create a docker-compose.yml file that:
-
Uses the official Anthropic image:
ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest -
Exposes required ports:
5900for VNC6080for noVNC (browser-based viewing)8501for Streamlit interface
-
Sets environment variables:
ANTHROPIC_API_KEYfrom host environmentWIDTH=1024andHEIGHT=768for screen resolution
-
Configures security:
--cap-drop=ALLto remove unnecessary capabilities- Read-only root filesystem where possible
- No privileged mode
-
Sets up volume mounts:
- A
./workspacefolder mounted to/home/user/workspacefor file sharing - This is the ONLY writable location the agent should access
- A
-
Network isolation (optional challenge):
- Create a custom network with limited external access
Expected Output Structure
version: '3.8'
services:
computer-use:
image: ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest
ports:
- "5900:5900"
- "6080:6080"
- "8501:8501"
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- WIDTH=1024
- HEIGHT=768
# ... security and volume configuration
Hints
- Use
${VARIABLE}syntax to reference host environment variables - The
cap_dropdirective removes Linux capabilities - Mount volumes with
:rwfor read-write or:rofor read-only
Grading Rubric
Uses correct Anthropic Docker image20 points
Exposes all three required ports (5900, 6080, 8501)20 points
Correctly sets environment variables including API key20 points
Implements security measures (cap_drop, limited privileges)20 points
Configures workspace volume mount correctly20 points
Your Solution
This lab requires YAML
YMLYAML(required)
3 free attempts remaining