This document explains how to set up Docker builds and deployment for CodeRunner across multiple platforms.
To enable automatic Docker Hub publishing, add these secrets to your GitHub repository:
-
Go to your Docker Hub account:
- Visit hub.docker.com
- Go to Account Settings → Security → New Access Token
- Create a token with Read, Write, Delete permissions
-
Add secrets to GitHub repository:
- Go to your GitHub repo → Settings → Secrets and variables → Actions
- Add these repository secrets:
DOCKER_USERNAME: your-dockerhub-username
DOCKER_TOKEN: your-dockerhub-access-token
The Docker build workflow runs on:
- Push to main/develop: Builds and pushes
docker-latesttag - Pull Requests: Builds only (no push) for testing
- Releases: Builds and pushes version tags like
v1.0.0-docker
# Run CodeRunner with Docker
docker run -d \
--name coderunner \
-p 8222:8222 \
-v ./uploads:/app/uploads \
instavm/coderunner:docker-latest
# Access MCP server
curl http://localhost:8222/mcp# Use the provided docker-compose.yml
docker compose up -d
# View logs
docker compose logs -f
# Stop service
docker compose downFASTMCP_HOST: Server host (default: 0.0.0.0)FASTMCP_PORT: Server port (default: 8222)
| Platform | Container Tool | Image Tag | Registry |
|---|---|---|---|
| macOS (Apple Silicon) | Apple container |
apple-latest |
OCI-compatible |
| Linux (x64/ARM64) | Docker | docker-latest |
Docker Hub |
| Windows | Docker Desktop | docker-latest |
Docker Hub |
{
"mcpServers": {
"coderunner": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-p", "8222:8222",
"-v", "./uploads:/app/uploads",
"instavm/coderunner:docker-latest"
]
}
}
}# Update openai_client.py to use Docker endpoint
hostname = "localhost" # Instead of coderunner.local
address = "127.0.0.1"
url = f"http://{address}:8222/mcp"# Standard Docker build
docker build -t coderunner-local .
# Multi-architecture build
docker buildx build --platform linux/amd64,linux/arm64 -t coderunner-multiarch .- Port conflicts: Change port mapping
-p 8223:8222 - Volume permissions: Ensure
./uploadsdirectory exists and is writable - Memory issues: Add memory limits
--memory 4g
# Check container status
docker ps
# Check logs
docker logs coderunner
# Test MCP endpoint
curl -f http://localhost:8222/mcp || echo "MCP not ready"