SuperAPI AI Directory

docker-first-runner

Deployment & operations

View repository

Updated 10-16 09:28

About this skill

Docker-First Executor

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
  1. Parse JSON output - The script returns structured data about available runtimes

  2. Choose execution method:

    • If docker.usable is true → use Docker
    • If Docker is unavailable → use scripts/version-compare.js Check local version
    • Build the appropriate command based on the comparison result
  3. 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