Overview

Full name
docker.io/onyxdotapp/code-interpreter
Registry
docker.io
Namespace
onyxdotapp
Repository
code-interpreter
Cached tags
7
Last synced
07/06/2026, 02:32 PM

Introduction

Onyx 文档问答平台的代码解释器 Sidecar 镜像,在沙箱中执行 Python 分析上传文件,需与 Onyx API 同网络部署。

Details

onyxdotapp/code-interpreter 为 Onyx(原 Danswer)RAG 平台提供隔离 Python 执行环境,API 将用户上传的 CSV/Excel 等发送至解释器运行 pandas 等分析并返回结果。典型作为 Onyx stack 的 companion 容器,独立公开服务。与 Jupyter 相比生命周期由 API 驱动、会话短;Kubernetes 中 Sidecar 或独立 Deployment 均可,需限制网络 egress 与 CPU/memory 配额防滥用。

快速启动

docker run -d --name onyx-code-interpreter \
  -p 9000:9000 \
  docker.io/onyxdotapp/code-interpreter:latest

推荐实践

docker run -d --name onyx-code-interpreter \
  --restart unless-stopped \
  -p 9000:9000 \
  -e MAX_EXECUTION_TIME=30 \
  -e ALLOWED_LIBRARIES=pandas,numpy \
  docker.io/onyxdotapp/code-interpreter:0.5.0

核心参数说明

  • -p 9000:9000 — 解释器 HTTP API 端口
  • -e MAX_EXECUTION_TIME — 单次脚本超时秒数
  • -e ALLOWED_LIBRARIES — 白名单 Python 库
  • --restart unless-stopped — Onyx 分析链路可用
  • 固定 tag — 与 Onyx API 版本配套
  • 安全 — 仅内网可达,禁止公网暴露

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  name: onyx-code-interpreter
spec:
  replicas: 2
  selector:
    matchLabels:
      app: onyx-code-interpreter
  template:
    metadata:
      labels:
        app: onyx-code-interpreter
    spec:
      containers:
        - name: interpreter
          image: docker.io/onyxdotapp/code-interpreter:0.5.0
          ports:
            - containerPort: 9000
          resources:
            limits:
              cpu: "1"
              memory: 1Gi
---
apiVersion: v1
kind: Service
metadata:
  name: onyx-code-interpreter
spec:
  selector:
    app: onyx-code-interpreter
  ports:
    - port: 9000
      targetPort: 9000

Onyx API 经 ClusterIP 调用;NetworkPolicy 限制仅 api namespace 可访问,按并发设置 HPA 与 resource limits。

Latest tags (20)

View all 7 tags →
TagArchPushed AtSizeDigestSyncWishAction
docker.io/onyxdotapp/code-interpreter
:latest
linux/amd64linux/arm64
2026/06/24 02:17184.9 MBsha256:c8ae28771996
docker.io/onyxdotapp/code-interpreter
:0.4.4
linux/amd64linux/arm64
2026/06/24 02:17184.9 MBsha256:c8ae28771996
docker.io/onyxdotapp/code-interpreter
:0.1.0
linux/amd64linux/arm64
2026/02/19 08:04180.6 MBsha256:6006206b0535
docker.io/onyxdotapp/code-interpreter
:test
linux/arm64
2025/11/22 07:43168.5 MBsha256:874637521c73
docker.io/onyxdotapp/code-interpreter
:buildcache
-2025/11/22 02:43--
docker.io/onyxdotapp/code-interpreter
:0
linux/amd64
2025/11/22 02:43175.3 MBsha256:179413e7dd93
docker.io/onyxdotapp/code-interpreter
:0.1
linux/amd64
2025/11/22 02:43175.3 MBsha256:179413e7dd93