> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/clore.ai/clore.ai-eng-zh/mian-xiang-zu-yong-zhe/docker-images.md).

# 可用的 Docker 镜像

在 Clore.ai 上租用 GPU 服务器时，您可以从预配置的 Docker 镜像中选择，或使用自己的自定义镜像。

## Clore 官方镜像

由 Clore.ai 维护的预构建镜像，针对去中心化 GPU 市场进行了优化。

### 通用用途

| Docker 镜像                                 | 描述                                | 端口       | 更新时间        |
| ----------------------------------------- | --------------------------------- | -------- | ----------- |
| `cloreai/jupyter:ubuntu24.04-v2`          | Ubuntu 24.04 上的 Jupyter Lab + SSH | 22, 8888 | 2025年1月 ✅   |
| `cloreai/ml-tools:0.1`                    | Jupyter Lab + VS Code Web 服务器     | 22, 8888 | 2023年7月 ⚠️  |
| `cloreai/ubuntu20.04-jupyter:latest`      | Ubuntu 20.04 + SSH + Jupyter      | 22, 8888 | 2022年11月 ⚠️ |
| `cloreai/ubuntu-20.04-remote-desktop:1.2` | 带远程桌面 GUI 的 Ubuntu                | 22, 3389 | 2023年5月 ⚠️  |
| `cloreai/torch:2.0.1`                     | PyTorch 2.0.1 + CUDA              | 22       | 2023年7月 ⚠️  |

### AI/ML 推理

| Docker 镜像                               | 描述                     | 端口   | 更新时间       |
| --------------------------------------- | ---------------------- | ---- | ---------- |
| `cloreai/deepseek-r1-8b:latest`         | 可直接运行的 DeepSeek R1 8B  | 8000 | 2025年1月 ✅  |
| `cloreai/stable-diffusion-webui:latest` | AUTOMATIC1111 SD WebUI | 7860 | 2023年9月 ⚠️ |
| `cloreai/oobabooga:1.5`                 | 文本生成 WebUI             | 7860 | 2023年8月 ⚠️ |

### 基础设施与挖矿

| Docker 镜像                   | 描述          | 更新时间       |
| --------------------------- | ----------- | ---------- |
| `cloreai/monitoring:0.7`    | 服务器监控代理     | 2024年9月 ✅  |
| `cloreai/hiveos:0.4`        | HiveOS 集成   | 2025年2月 ✅  |
| `cloreai/openvpn-proxy:0.2` | VPN/代理转发    | 2025年2月 ✅  |
| `cloreai/proxy:0.2`         | 端口转发系统      | 2024年1月    |
| `cloreai/automining:0.1`    | 自动挖矿设置      | 2023年6月 ⚠️ |
| `cloreai/kuzco:latest`      | Kuzco 分布式推理 | 2025年6月 ✅  |
| `cloreai/partner:nastya-01` | 合作伙伴集成工具    | 2025年4月 ✅  |

> ⚠️ 标有 ⚠️ 的镜像已超过一年未更新。对于 ML 任务，请考虑使用下面的 **社区镜像** ，它们提供了更新的 CUDA 和框架版本。

## 推荐的社区镜像

来自更广泛 AI/ML 社区、经过实战检验且持续维护并使用较新版本的镜像。

### 深度学习框架

| 镜像                      | 标签                               | 描述                      | 场景             | 端口                |
| ----------------------- | -------------------------------- | ----------------------- | -------------- | ----------------- |
| `pytorch/pytorch`       | `2.10.0-cuda13.0-cudnn9-runtime` | 带 CUDA 13.0 的最新 PyTorch | 深度学习训练/推理      | 8888（Jupyter）     |
| `nvidia/cuda`           | `13.1.1-runtime-ubuntu22.04`     | NVIDIA CUDA 运行时         | 自定义 CUDA 应用程序  | -                 |
| `nvidia/cuda`           | `13.1.1-devel-ubuntu22.04`       | CUDA 开发工具               | 构建 CUDA 项目     | -                 |
| `tensorflow/tensorflow` | `2.15.0-gpu`                     | TensorFlow GPU 支持       | TensorFlow 工作流 | 8888（TensorBoard） |

### LLM 推理引擎

| 镜像                                              | 标签       | 描述               | 场景           | 端口    |
| ----------------------------------------------- | -------- | ---------------- | ------------ | ----- |
| `vllm/vllm-openai`                              | `latest` | 高性能 LLM 服务       | 生产级 LLM API  | 8000  |
| `ghcr.io/huggingface/text-generation-inference` | `3.3.5`  | Hugging Face TGI | 企业级 LLM 服务   | 80    |
| `ollama/ollama`                                 | `latest` | 本地 LLM 运行器       | 本地/边缘 LLM 部署 | 11434 |

### 图像生成

| 镜像                                | 标签       | 描述                     | 场景      | 端口   |
| --------------------------------- | -------- | ---------------------- | ------- | ---- |
| `goolashe/automatic1111-sd-webui` | `latest` | Stable Diffusion WebUI | AI 艺术生成 | 7860 |
| `sinfallas/comfyui`               | `latest` | 基于节点的 ComfyUI SD       | 高级图像工作流 | 8188 |

### 开发环境

| 镜像                            | 标签                             | 描述                   | 场景     | 端口   |
| ----------------------------- | ------------------------------ | -------------------- | ------ | ---- |
| `jupyter/tensorflow-notebook` | `latest`                       | Jupyter + TensorFlow | ML 试验  | 8888 |
| `jupyter/pytorch-notebook`    | `latest`                       | Jupyter + PyTorch    | 深度学习研究 | 8888 |
| `cschranz/gpu-jupyter`        | `v1.10_cuda-12.9_ubuntu-24.04` | 支持 GPU 的 Jupyter     | GPU 计算 | 8888 |

## 选择镜像

### 通过 Web 界面

1. 前往 **市场** → 找到服务器 → **租用**
2. 在订单表单中，选择 **Docker 镜像** 下拉菜单中的
3. 从预配置选项中选择或输入自定义镜像
4. 配置暴露端口（逗号分隔： `8888,7860,8000`)
5. 如有需要，添加环境变量
6. 提交订单

### 通过 API

```json
{
  "image": "pytorch/pytorch:2.10.0-cuda13.0-cudnn9-runtime",
  "ports": [8888, 8000],
  "env": {
    "JUPYTER_ENABLE_LAB": "yes"
  }
}
```

## 自定义 Docker 镜像

### 支持的镜像仓库

* **Docker Hub**: `username/image:tag`
* **GitHub Container Registry**: `ghcr.io/user/image:tag`
* **NVIDIA NGC**: `nvcr.io/nvidia/image:tag`
* **Google Container Registry**: `gcr.io/project/image:tag`

### 示例

```bash
# 带 CUDA 12.1 的最新 PyTorch
pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime

# NVIDIA CUDA 基础镜像
nvidia/cuda:12.2.0-base-ubuntu22.04

# Hugging Face Transformers
huggingface/transformers-pytorch-gpu:4.35.0

# 自定义镜像
your-username/my-ai-model:v1.0
```

### 自定义镜像要求

* ✅ 必须可公开访问
* ✅ 对于 GPU 实例，应包含 NVIDIA GPU 支持
* ✅ 基于支持 CUDA 的镜像以获得 GPU 加速
* ✅ 包含必要的驱动和库
* ⚠️ 大镜像（>10GB）可能需要更长时间下载

## 端口配置

暴露端口以便让您的应用程序可从外部访问：

| 端口    | 常见用途                 | 框架                 |
| ----- | -------------------- | ------------------ |
| 22    | SSH 访问               | 系统                 |
| 8888  | Jupyter Notebook/Lab | Jupyter            |
| 7860  | Gradio 界面            | SD WebUI、Gradio 应用 |
| 8000  | API 服务器              | vLLM、FastAPI       |
| 3000  | Web 应用               | React、Node.js      |
| 8080  | HTTP 服务              | 通用 Web 服务          |
| 11434 | Ollama API           | Ollama             |
| 8188  | ComfyUI 界面           | ComfyUI            |

### 在订单表单中设置端口

```
8888,7860,8000
```

## 环境变量

将配置传递给您的容器：

### 常见示例

```bash
# Hugging Face 令牌
HF_TOKEN=hf_your_token_here

# 模型配置
MODEL_NAME=meta-llama/Llama-2-7b-chat-hf
CUDA_VISIBLE_DEVICES=0

# Jupyter 配置
JUPYTER_ENABLE_LAB=yes
JUPYTER_TOKEN=your_secure_token

# vLLM 配置
VLLM_WORKER_MULTIPROC_METHOD=spawn
```

### 安全说明

* ❌ 不要把密钥放在环境变量中
* ✅ 使用临时令牌或 API 密钥
* ✅ 在可能的情况下将密钥以卷的形式挂载

## 持久化存储

### 存储位置

* `/workspace` - 通常在租用期间保持持久化
* `/root` - 可能会在容器重启时重置
* `/tmp` - 临时存储，不持久化

### 最佳实践

* 将重要数据存储在 `/workspace`
* 使用外部存储进行备份（S3、GCS 等）
* 将模型下载到持久化目录
* 对大型数据集使用卷挂载

## 最佳实践

### 镜像选择

1. **使用最新标签** - 避免 `latest` 在生产环境中，优先使用版本化标签
2. **选择合适的基础镜像** - 将 CUDA 版本与您的框架匹配
3. **考虑镜像大小** - 更小的镜像下载更快
4. **检查维护情况** - 优先选择积极维护的镜像

### 安全

1. **暴露最少端口** - 只暴露您需要的端口
2. **使用身份验证** - 为 Jupyter/Web 界面设置令牌
3. **定期更新** - 使用较新的镜像版本
4. **监控访问** - 检查谁连接到了您的服务

### 性能

1. **GPU 兼容性** - 确认 CUDA 版本符合您的需求
2. **预下载模型** - 在自定义镜像中包含模型以加快启动
3. **优化容器** - 使用多阶段构建，尽量减少层数
4. **缓存管理** - 利用 Docker 层缓存

## 故障排除

### 镜像无法启动

```bash
# 检查镜像是否存在且为公开
docker pull your-image:tag

# 验证 CUDA 兼容性
nvidia-smi
nvcc --version
```

**常见问题：**

* 镜像不存在或是私有的
* CUDA 版本不兼容
* 磁盘空间不足
* 架构错误（arm64 与 x86\_64）

### GPU 无法访问

```bash
# 检查 GPU 可用性
nvidia-smi

# 在容器中测试 CUDA
python -c "import torch; print(torch.cuda.is_available())"
```

**解决方案：**

* 使用支持 GPU 的基础镜像
* 确保 NVIDIA Container Toolkit 可用
* 检查 CUDA 驱动兼容性

### 无法访问暴露的端口

1. 等待容器完全启动（查看日志）
2. 验证服务是否在容器内运行： `netstat -tlnp`
3. 检查服务是否绑定到 0.0.0.0，而不是 127.0.0.1
4. 确认端口已在订单表单中暴露

### 性能问题

* 为模型权重使用本地 SSD 存储
* 根据可用 GPU 内存优化 batch 大小
* 监控 GPU 利用率： `nvidia-smi -l 1`
* 检查 CPU/内存使用情况： `htop`

## 快速开始示例

### 使用 PyTorch 部署 Jupyter

```bash
镜像：pytorch/pytorch:2.10.0-cuda13.0-cudnn9-runtime
端口：8888
命令：jupyter lab --ip=0.0.0.0 --allow-root --no-browser
```

### 部署 vLLM API 服务器

```bash
镜像：vllm/vllm-openai:latest
端口：8000
环境变量：MODEL_NAME=microsoft/DialoGPT-medium
命令：python -m vllm.entrypoints.openai.api_server --model $MODEL_NAME --host 0.0.0.0
```

### 部署 Stable Diffusion WebUI

```bash
镜像：goolashe/automatic1111-sd-webui:latest
端口：7860
命令：--listen --api --xformers
```

### 部署 Ollama

```bash
镜像：ollama/ollama:latest
端口：11434
命令：ollama serve
# 然后：ollama run llama2（在容器内）
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/clore.ai/clore.ai-eng-zh/mian-xiang-zu-yong-zhe/docker-images.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
