{
  "id": "docker/container-exit-code-1-during-build",
  "signature": "ERROR: Service 'app' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1",
  "signature_zh": "错误：服务 'app' 构建失败：命令 '/bin/sh -c pip install -r requirements.txt' 返回了非零退出码：1",
  "regex": "The command.*returned a non-zero code:\\s*\\d+",
  "domain": "docker",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "A RUN command in Dockerfile fails, usually due to missing dependencies, network issues, or incorrect package versions.",
  "root_cause_type": "generic",
  "root_cause_zh": "Dockerfile 中的 RUN 命令失败，通常由于缺少依赖、网络问题或软件包版本不正确。",
  "versions": [
    {
      "version": "Docker 24.0.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Docker 25.0.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Docker 23.0.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Adding --no-cache-dir to pip install does not fix underlying package conflicts or network errors.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Running the command manually inside a running container without the correct base image may succeed but fail during build due to different environment.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the specific error message in the build output (e.g., 'Could not find a version that satisfies the requirement'). Then update requirements.txt or base image. Example: use 'pip install --upgrade pip' before installing requirements.",
      "success_rate": 0.85,
      "how": "Check the specific error message in the build output (e.g., 'Could not find a version that satisfies the requirement'). Then update requirements.txt or base image. Example: use 'pip install --upgrade pip' before installing requirements.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If network issues, add a retry mechanism in the RUN command: RUN pip install -r requirements.txt || (sleep 5 && pip install -r requirements.txt)",
      "success_rate": 0.75,
      "how": "If network issues, add a retry mechanism in the RUN command: RUN pip install -r requirements.txt || (sleep 5 && pip install -r requirements.txt)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check the specific error message in the build output (e.g., 'Could not find a version that satisfies the requirement'). Then update requirements.txt or base image. Example: use 'pip install --upgrade pip' before installing requirements.",
    "If network issues, add a retry mechanism in the RUN command: RUN pip install -r requirements.txt || (sleep 5 && pip install -r requirements.txt)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.docker.com/engine/reference/builder/#run",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}