A guide for deciding whether to use Docker containerization or local execution when running scripts.
When to Use
- Run/execute Python scripts
- Run/execute Node.js scripts
- Run/execute any code file
- Execute commands that require a specific runtime version
Quick Start
# 1. 检测环境
node scripts/detect-env.js
# 2. 如需要,比较版本
node scripts/version-compare.js "$(本地版本)" "$(所需版本)"
3. Execute using the selected method
## 工作流程
1. **使用 `scripts/detect-env.js` 检测环境**
```bash
node scripts/detect-env.js
-
Parse JSON output - The script returns structured data about available runtimes
-
Choose execution method:
- If
docker.usableis true → use Docker - If Docker is unavailable → use
scripts/version-compare.jsCheck local version - Build the appropriate command based on the comparison result
- If
-
Execute using the selected method
Reference Files
| File | Purpose |
|---|---|
scripts/detect-env.js |
Environment detection - check Docker and local runtimes |
scripts/version-compare.js |
Version comparison tool |
references/language-matrix.md |
Version requirements for each language |
references/strategy-guide.md |
Detailed decision logic and edge cases |