sandboxbox 1.2.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +180 -99
- package/cli.js +125 -162
- package/package.json +11 -12
- package/BUBBLEWRAP-REALITY.md +0 -210
- package/Dockerfile.test +0 -16
- package/USAGE.md +0 -111
- package/bin/bwrap +0 -0
- package/build-final.log +0 -2217
- package/build-output.log +0 -289
- package/complete-build.log +0 -231
- package/container.js +0 -847
- package/debug-cli.js +0 -15
- package/final-build.log +0 -268
- package/final-complete-build.log +0 -240
- package/full-build.log +0 -234
- package/init-firewall.sh +0 -36
- package/lib/bubblewrap.js +0 -203
- package/npm-build-test.log +0 -410
- package/playwright.sh +0 -183
- package/run.sh +0 -12
- package/sandboxbox-sandbox/build.sh +0 -83
- package/scripts/build.js +0 -303
- package/scripts/download-bubblewrap.js +0 -186
- package/test-cli.js +0 -72
- package/test-project/Dockerfile.sandboxbox +0 -20
package/README.md
CHANGED
@@ -1,150 +1,231 @@
|
|
1
1
|
# SandboxBox
|
2
2
|
|
3
|
-
**
|
3
|
+
**Cross-platform container runner with Claude Code and Playwright support**
|
4
4
|
|
5
|
-
Run
|
5
|
+
Run your projects in isolated containers using Podman. Works on **Windows, macOS, and Linux**.
|
6
6
|
|
7
|
-
##
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
No installation required! Use with `npx`:
|
8
10
|
|
9
|
-
### One-Time Setup
|
10
11
|
```bash
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
npx sandboxbox build
|
13
|
+
npx sandboxbox run ./my-project
|
14
|
+
```
|
15
|
+
|
16
|
+
## Quick Start
|
14
17
|
|
15
|
-
|
16
|
-
|
18
|
+
### 1. Install Podman (One-time)
|
19
|
+
|
20
|
+
**Windows:**
|
21
|
+
```powershell
|
22
|
+
winget install RedHat.Podman
|
17
23
|
```
|
18
24
|
|
19
|
-
|
25
|
+
**macOS:**
|
20
26
|
```bash
|
21
|
-
|
22
|
-
|
27
|
+
brew install podman
|
28
|
+
podman machine init
|
29
|
+
podman machine start
|
30
|
+
```
|
23
31
|
|
24
|
-
|
25
|
-
|
32
|
+
**Linux:**
|
33
|
+
```bash
|
34
|
+
sudo apt-get install podman # Ubuntu/Debian
|
35
|
+
sudo dnf install podman # Fedora
|
36
|
+
sudo apk add podman # Alpine
|
37
|
+
```
|
26
38
|
|
27
|
-
|
28
|
-
|
39
|
+
### 2. Build Container
|
40
|
+
|
41
|
+
```bash
|
42
|
+
npx sandboxbox build
|
29
43
|
```
|
30
44
|
|
31
|
-
|
45
|
+
This builds a container with:
|
46
|
+
- Node.js v22
|
47
|
+
- Claude Code CLI
|
48
|
+
- Playwright with all browser dependencies
|
49
|
+
- Git, npm, and essential build tools
|
50
|
+
|
51
|
+
### 3. Run Your Project
|
52
|
+
|
32
53
|
```bash
|
33
|
-
#
|
34
|
-
npx sandboxbox
|
54
|
+
# Run with default shell
|
55
|
+
npx sandboxbox run ./my-project
|
35
56
|
|
36
|
-
# Run
|
37
|
-
npx sandboxbox run ./project
|
38
|
-
|
57
|
+
# Run custom command
|
58
|
+
npx sandboxbox run ./my-project "npm test"
|
59
|
+
|
60
|
+
# Run Claude Code
|
61
|
+
npx sandboxbox run ./my-project "claude --help"
|
39
62
|
|
40
|
-
|
63
|
+
# Run Playwright tests
|
64
|
+
npx sandboxbox run ./my-project "npx playwright test"
|
65
|
+
```
|
41
66
|
|
42
|
-
|
43
|
-
|---------|-------------|
|
44
|
-
| `setup` | Set up Alpine Linux environment (one-time) |
|
45
|
-
| `build <dockerfile>` | Build container from Dockerfile |
|
46
|
-
| `run <project>` | Run Playwright tests in isolation |
|
47
|
-
| `shell <project>` | Interactive shell in container |
|
48
|
-
| `quick-test <project>` | Quick test with sample Dockerfile |
|
49
|
-
| `version` | Show version information |
|
67
|
+
### 4. Interactive Shell
|
50
68
|
|
51
|
-
|
69
|
+
```bash
|
70
|
+
npx sandboxbox shell ./my-project
|
71
|
+
```
|
52
72
|
|
53
|
-
|
54
|
-
- **1MB memory overhead** (50x less than Docker)
|
55
|
-
- **True isolation** with Linux namespaces
|
56
|
-
- **Zero privileges** after bubblewrap installation
|
73
|
+
## Features
|
57
74
|
|
58
|
-
|
75
|
+
### 🌍 Cross-Platform
|
76
|
+
- **Windows** - Full support with Podman Desktop
|
77
|
+
- **macOS** - Works with Podman machine
|
78
|
+
- **Linux** - Native Podman support
|
59
79
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
✅ **Process isolation** - Separate PID namespace
|
80
|
+
### 🔒 Isolation
|
81
|
+
- Complete container isolation
|
82
|
+
- Your host system stays clean
|
83
|
+
- Workspace mounted at `/workspace`
|
65
84
|
|
66
|
-
|
85
|
+
### 🚀 Pre-installed Tools
|
86
|
+
- **Node.js v22**
|
87
|
+
- **Claude Code CLI** - AI-powered development
|
88
|
+
- **Playwright** - Browser automation with all dependencies
|
89
|
+
- **Git** - Version control
|
90
|
+
- **npm** - Package management
|
67
91
|
|
68
|
-
|
69
|
-
|
70
|
-
|
92
|
+
### 📦 NPX-First Design
|
93
|
+
- No global installation needed
|
94
|
+
- Single command execution
|
95
|
+
- Works with any project directory
|
71
96
|
|
72
|
-
##
|
97
|
+
## Commands
|
73
98
|
|
74
|
-
### Local Script
|
75
99
|
```bash
|
76
|
-
#
|
77
|
-
|
100
|
+
# Build container from Dockerfile
|
101
|
+
npx sandboxbox build
|
102
|
+
npx sandboxbox build ./Dockerfile.custom
|
103
|
+
|
104
|
+
# Run project in container
|
105
|
+
npx sandboxbox run <project-dir> [command]
|
78
106
|
|
79
|
-
#
|
80
|
-
|
107
|
+
# Interactive shell
|
108
|
+
npx sandboxbox shell <project-dir>
|
109
|
+
|
110
|
+
# Show version
|
111
|
+
npx sandboxbox version
|
81
112
|
```
|
82
113
|
|
83
|
-
|
84
|
-
```bash
|
85
|
-
# Install in your project
|
86
|
-
npm install sandboxbox
|
114
|
+
## How It Works
|
87
115
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
116
|
+
1. **Builds** a container image from the Dockerfile using Podman
|
117
|
+
2. **Mounts** your project directory to `/workspace` in the container
|
118
|
+
3. **Runs** your command in the isolated container environment
|
119
|
+
4. **Removes** the container automatically when done
|
120
|
+
|
121
|
+
```
|
122
|
+
Your Project Container
|
123
|
+
./my-project ━━━━━> /workspace
|
124
|
+
(host) (isolated)
|
95
125
|
```
|
96
126
|
|
97
|
-
##
|
127
|
+
## Use Cases
|
128
|
+
|
129
|
+
### Run Claude Code
|
130
|
+
```bash
|
131
|
+
npx sandboxbox run ./my-app "claude --version"
|
132
|
+
npx sandboxbox run ./my-app "claude code review lib/"
|
133
|
+
```
|
134
|
+
|
135
|
+
### Run Playwright Tests
|
136
|
+
```bash
|
137
|
+
npx sandboxbox run ./my-app "npx playwright test"
|
138
|
+
npx sandboxbox run ./my-app "npx playwright test --headed"
|
139
|
+
```
|
98
140
|
|
99
|
-
###
|
141
|
+
### Development Workflow
|
100
142
|
```bash
|
101
|
-
#
|
102
|
-
|
103
|
-
npm init -y
|
104
|
-
npm install playwright
|
143
|
+
# Build once
|
144
|
+
npx sandboxbox build
|
105
145
|
|
106
|
-
#
|
107
|
-
|
108
|
-
import { test, expect } from '@playwright/test';
|
146
|
+
# Interactive development
|
147
|
+
npx sandboxbox shell ./my-app
|
109
148
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
149
|
+
# Inside container:
|
150
|
+
npm install
|
151
|
+
npm test
|
152
|
+
git commit -am "Update"
|
153
|
+
exit
|
154
|
+
```
|
115
155
|
|
116
|
-
|
117
|
-
|
156
|
+
### Run npm Scripts
|
157
|
+
```bash
|
158
|
+
npx sandboxbox run ./my-app "npm run build"
|
159
|
+
npx sandboxbox run ./my-app "npm run lint"
|
160
|
+
npx sandboxbox run ./my-app "npm run test:e2e"
|
118
161
|
```
|
119
162
|
|
120
|
-
|
163
|
+
## Custom Dockerfile
|
164
|
+
|
165
|
+
Create your own `Dockerfile`:
|
166
|
+
|
121
167
|
```dockerfile
|
122
|
-
|
123
|
-
|
168
|
+
FROM node:22-alpine
|
169
|
+
|
170
|
+
# Install system dependencies
|
171
|
+
RUN apk add --no-cache git bash curl
|
124
172
|
|
125
|
-
|
126
|
-
|
127
|
-
COPY package*.json ./
|
128
|
-
RUN npm install
|
129
|
-
COPY . .
|
173
|
+
# Install global packages
|
174
|
+
RUN npm install -g @anthropic-ai/claude-code @playwright/test
|
130
175
|
|
131
|
-
|
176
|
+
# Install Playwright browsers
|
177
|
+
RUN npx playwright install --with-deps chromium
|
178
|
+
|
179
|
+
WORKDIR /workspace
|
180
|
+
|
181
|
+
CMD ["/bin/bash"]
|
132
182
|
```
|
133
183
|
|
184
|
+
Then build:
|
134
185
|
```bash
|
135
|
-
|
136
|
-
|
137
|
-
|
186
|
+
npx sandboxbox build ./Dockerfile
|
187
|
+
```
|
188
|
+
|
189
|
+
## Requirements
|
190
|
+
|
191
|
+
- **Podman** (https://podman.io/getting-started/installation)
|
192
|
+
- **Node.js 16+** (for running npx)
|
193
|
+
|
194
|
+
## Project Structure
|
195
|
+
|
196
|
+
```
|
197
|
+
sandboxbox/
|
198
|
+
├── cli.js # Main CLI - Podman integration
|
199
|
+
├── Dockerfile # Container definition
|
200
|
+
├── package.json # NPM package config
|
201
|
+
└── README.md # This file
|
138
202
|
```
|
139
203
|
|
140
|
-
##
|
204
|
+
## Why Podman?
|
205
|
+
|
206
|
+
- ✅ **Cross-platform** - Works on Windows, macOS, Linux
|
207
|
+
- ✅ **Rootless** - No daemon, runs as regular user
|
208
|
+
- ✅ **Docker-compatible** - Uses OCI standard containers
|
209
|
+
- ✅ **Secure** - Better security model than Docker
|
210
|
+
- ✅ **Fast** - Lightweight and efficient
|
211
|
+
|
212
|
+
## Differences from v1.x
|
213
|
+
|
214
|
+
**v1.x (bubblewrap):**
|
215
|
+
- Linux-only
|
216
|
+
- Required bubblewrap installation
|
217
|
+
- Direct process isolation
|
218
|
+
|
219
|
+
**v2.x (Podman):**
|
220
|
+
- Cross-platform (Windows/macOS/Linux)
|
221
|
+
- Uses Podman containers
|
222
|
+
- OCI-standard container images
|
223
|
+
- More portable and widely supported
|
224
|
+
|
225
|
+
## License
|
141
226
|
|
142
|
-
|
143
|
-
- **Bubblewrap (bwrap)** - Linux namespace isolation
|
144
|
-
- **Alpine Linux** - Lightweight base filesystem
|
145
|
-
- **System Chromium** - Avoids glibc compatibility issues
|
146
|
-
- **Xvfb** - Virtual display for headless testing
|
227
|
+
MIT
|
147
228
|
|
148
|
-
##
|
229
|
+
## Contributing
|
149
230
|
|
150
|
-
|
231
|
+
Contributions welcome! This project focuses on cross-platform container execution with Claude Code and Playwright support using Podman.
|