当前位置:论坛首页 > Linux面板 > 求助

【已解答】通过Docker模块“构建镜像”功能构建镜像总是...

发表在 Linux面板2026-5-26 00:02 [复制链接] 2 382

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:2026-04-21 11:42:07 - Linux面板11.7.0

Docker版本                         29.5.1
docker-compose版本     5.1.3
unix地址                               unix:///var/run/docker.sock
数据目录                               /work/docker
系统版本:Ubuntu 22.04.5 LTS

架构                                       x86_64
内核版本                              5.15.0-179-generic
CPU核心                              12
内存大小                              47.14 GB
问题描述:通过“构建镜像”功能构建镜像总是报错无法成功构建。

但使用以下命令则可正常构建:
cd /data/scripts/myhloli_mineru

docker build \
  -f docker/china/gcu.Dockerfile \
  -t mineru:myhloli-2.7.1 \
  .


请排查是否为“构建镜像”功能BUG,Dockerfile内容如下:

# Base image containing the vLLM inference environment, requiring amd64(x86-64) CPU + Enflame GCU.
FROM crpi-vofi3w62lkohhxsp.cn-shanghai.personal.cr.aliyuncs.com/opendatalab-mineru/gcu:docker_images_topsrider_i3x_3.6.20260106_vllm0.11_pytorch2.8.0


# Install Noto fonts for Chinese characters
RUN echo 'deb http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse\n\
deb http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse' > /tmp/aliyun-sources.list && \
    apt-get -o Dir::Etc::SourceList=/tmp/aliyun-sources.list update && \
    apt-get -o Dir::Etc::SourceList=/tmp/aliyun-sources.list install -y \
        fonts-noto-core \
        fonts-noto-cjk \
        fontconfig && \
    fc-cache -fv && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/aliyun-sources.list

# Install mineru latest
RUN python3 -m pip install "mineru[core]>=3.0.0" \
                            numpy==1.26.4 \
                            opencv-python==4.11.0.86 \
                            -i https://mirrors.aliyun.com/pypi/simple && \
    python3 -m pip cache purge

# Download models and update the configuration file
RUN /bin/bash -c "mineru-models-download -s modelscope -m all"

# Set the entry point to activate the virtual environment and run the command line tool
ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]


相关截图(日志、错误):暂无

使用道具 举报 只看该作者 回复
发表于 2026-5-26 01:23:08 | 显示全部楼层
找到原因了,报错是因为构建镜像太大(47G)导致的报错,实际还在运行,但报错后会构建多个无效镜像,还需要手动删除,最终还得是命令操作,进度直观、不报错。官方可就此问题修复下,也算是大容量镜像下的bug吧!~
使用道具 举报 回复 支持 反对
发表于 2026-5-26 15:12:45 | 显示全部楼层
shanyh 发表于 2026-5-26 01:23
找到原因了,报错是因为构建镜像太大(47G)导致的报错,实际还在运行,但报错后会构建多个无效镜像,还需 ...
  1. # Base image (amd64 + Enflame GCU / vLLM 0.11 / PyTorch 2.8.0)
  2. FROM crpi-vofi3w62lkohhxsp.cn-shanghai.personal.cr.aliyuncs.com/opendatalab-mineru/gcu:docker_images_topsrider_i3x_3.6.20260106_vllm0.11_pytorch2.8.0

  3. # 切换阿里源(稳定不报错)
  4. RUN rm -f /etc/apt/sources.list.d/* && \
  5.     echo 'deb http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse' > /etc/apt/sources.list && \
  6.     echo 'deb http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse' >> /etc/apt/sources.list && \
  7.     echo 'deb http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse' >> /etc/apt/sources.list && \
  8.     apt update && apt install -y --no-install-recommends \
  9.         fonts-noto-core \
  10.         fonts-noto-cjk \
  11.         fontconfig \
  12.         libgl1-mesa-glx \
  13.         libglib2.0-0 && \
  14.     fc-cache -fv && \
  15.     apt clean && \
  16.     rm -rf /var/lib/apt/lists/*

  17. # 安装 Python 依赖(固定版本避免冲突)
  18. RUN python3 -m pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple && \
  19.     python3 -m pip install \
  20.         "mineru[core]>=3.0.0" \
  21.         numpy==1.26.4 \
  22.         opencv-python==4.11.0.86 \
  23.         -i https://mirrors.aliyun.com/pypi/simple && \
  24.     python3 -m pip cache purge

  25. # 下载模型(modelscope 加速)
  26. ENV MINERU_MODEL_SOURCE=local
  27. RUN mineru-models-download -s modelscope -m all

  28. # 工作目录
  29. WORKDIR /app

  30. # 入口(兼容 docker run / 自定义命令)
  31. ENTRYPOINT ["/bin/bash", "-c"]
  32. CMD ["exec "$@"", "--"]
复制代码


您好,根据您当前的Dockerfile做出了简单的优化
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表