Enhance docker toolbox with Office, OCR, media and Node.js tooling

This commit is contained in:
JOJO 2026-06-27 23:43:39 +08:00
parent 737c4d61a2
commit 6f47221ed8
2 changed files with 49 additions and 1 deletions

View File

@ -4,6 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \ LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8
# 1. 安装系统工具与运行时库
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
bash \ bash \
@ -18,15 +19,54 @@ RUN apt-get update && \
unzip \ unzip \
locales \ locales \
tzdata \ tzdata \
iputils-ping && \ iputils-ping \
# Office 转换
libreoffice \
pandoc \
poppler-utils \
# 图片/视频/媒体
imagemagick \
ffmpeg \
# OCR
tesseract-ocr \
tesseract-ocr-chi-sim \
tesseract-ocr-chi-tra \
# 网页截图 / 自动化
chromium \
# 开发辅助工具
jq \
ripgrep \
fd-find \
tree \
# 字体
fonts-noto-cjk \
fonts-noto-color-emoji \
fonts-liberation && \
sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && \ sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && \
locale-gen && \ locale-gen && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# 2. 允许 ImageMagick 处理 PDF默认被安全策略禁止
RUN if [ -f /etc/ImageMagick-6/policy.xml ]; then \
sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read|write" pattern="PDF" \/>/g' /etc/ImageMagick-6/policy.xml; \
fi
# 3. 安装 Node.js 20 LTS复用 curl已在上方安装
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
rm -rf /var/lib/apt/lists/* && \
node --version && \
npm --version
# 3.5 全局安装 office skill 需要的 Node 包
RUN npm install -g docx pptxgenjs && \
npm cache clean --force
WORKDIR /opt/workspace WORKDIR /opt/workspace
COPY docker/toolbox-requirements.txt /tmp/toolbox-requirements.txt COPY docker/toolbox-requirements.txt /tmp/toolbox-requirements.txt
# 4. 创建 Python 虚拟环境并安装依赖
RUN python -m venv /opt/agent-venv && \ RUN python -m venv /opt/agent-venv && \
/opt/agent-venv/bin/pip install --no-cache-dir --upgrade pip && \ /opt/agent-venv/bin/pip install --no-cache-dir --upgrade pip && \
/opt/agent-venv/bin/pip install --no-cache-dir -r /tmp/toolbox-requirements.txt && \ /opt/agent-venv/bin/pip install --no-cache-dir -r /tmp/toolbox-requirements.txt && \
@ -34,3 +74,5 @@ RUN python -m venv /opt/agent-venv && \
ENV AGENT_TOOLBOX_VENV=/opt/agent-venv ENV AGENT_TOOLBOX_VENV=/opt/agent-venv
ENV PATH="/opt/agent-venv/bin:${PATH}" ENV PATH="/opt/agent-venv/bin:${PATH}"
ENV NODE_PATH="/usr/lib/node_modules"

View File

@ -16,3 +16,9 @@ openpyxl==3.1.5
python-pptx==1.0.2 python-pptx==1.0.2
pdfplumber==0.11.4 pdfplumber==0.11.4
PyPDF2==3.0.1 PyPDF2==3.0.1
# office skill 运行必需
defusedxml
markitdown[docx]
# OCR / PDF 转图片
pytesseract
pdf2image