当前位置: 首页 > article >正文

【瞎折腾/ragflow】构建docker镜像并部署使用ragflow

说在前面

  • 操作系统:win11
  • docker desktop版本:4.29.0
  • docker engin版本:v26.0.0
  • ragflow版本:nightly

安装docker

  • 官网
    在这里插入图片描述
  • 如果是win11,backend建议使用wsl2
    在这里插入图片描述
  • 安装好后打开docker desktop,不然docker命令用不了

下载RAGFlow源码

  • 直接git就行
    git clone https://github.com/infiniflow/ragflow.git
    cd ragflow/
    
  • 修改相关配置,在build时候走国内源
  • 修改Dockerfile
    ARG NEED_MIRROR=0改为ARG NEED_MIRROR=1
    在这里插入图片描述
  • 修改.env
    将以下红框内的取消注释
    在这里插入图片描述
  • 开始艰难的build过程
    docker build -f Dockerfile -t infiniflow/ragflow:nightly .
    
  • 似乎在折腾我的C盘
  • 结果
    **[+] Building 0.0s (0/0)  docker:default
    2025/03/08 02:04:14 http2: server: error reading preface from client //./pipe/docker_engine: file has already been close[+] Building 37.0s (26/44)                                                                               docker:default
    [+] Building 37.1s (26/44)                                                                               docker:default                                                                         docker:default
    [+] Building 510.8s (45/45) FINISHED                                                                     docker:default
     => [internal] load build definition from Dockerfile                                                               0.0s
     => => transferring dockerfile: 8.79kB                                                                             0.0s
     => [internal] load metadata for docker.io/infiniflow/ragflow_deps:latest                                          5.0s
     => [internal] load metadata for docker.io/library/ubuntu:22.04                                                    3.1s
     => [internal] load .dockerignore                                                                                  0.0s
     => => transferring context: 2B                                                                                    0.0s
     => [internal] load build context                                                                                  0.2s
     => => transferring context: 93.88kB                                                                               0.1s
     => FROM docker.io/infiniflow/ragflow_deps:latest@sha256:d963eef897cc6254ef2cadb4977c537b7791492931052df2af180450  0.0s
     => [base  1/15] FROM docker.io/library/ubuntu:22.04@sha256:ed1544e454989078f5dec1bfdabd8c5cc9c48e0705d07b678ab6a  0.0s
     => CACHED [base  2/15] WORKDIR /ragflow                                                                           0.0s
     => CACHED [base  3/15] RUN mkdir -p /ragflow/rag/res/deepdoc /root/.ragflow                                       0.0s
     => CACHED [base  4/15] RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/huggingface.co,target=/  0.0s
     => CACHED [base  5/15] RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/huggingface.co,target=/  0.0s
     => CACHED [base  6/15] RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/,target=/deps     cp -r  0.0s
     => CACHED [base  7/15] RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked     if [ "1" =  0.0s
     => CACHED [base  8/15] RUN if [ "1" == "1" ]; then         pip3 config set global.index-url https://mirrors.aliy  0.0s
     => CACHED [base  9/15] RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked     curl -fsSL  0.0s
     => CACHED [base 10/15] RUN apt update && apt install -y curl build-essential     && if [ "1" == "1" ]; then       0.0s
     => CACHED [base 11/15] RUN cargo --version && rustc --version                                                     0.0s
     => CACHED [base 12/15] RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked     curl https  0.0s
     => CACHED [base 13/15] RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/chrome-linux64-121-0-61  0.0s
     => CACHED [base 14/15] RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/chromedriver-linux64-12  0.0s
     => CACHED [base 15/15] RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/,target=/deps     if [   0.0s
     => CACHED [production  1/16] WORKDIR /ragflow                                                                     0.0s
     => CACHED [builder 2/8] COPY pyproject.toml uv.lock ./                                                            0.0s
     => CACHED [builder 3/8] RUN --mount=type=cache,id=ragflow_uv,target=/root/.cache/uv,sharing=locked     if [ "1"   0.0s
     => CACHED [builder 4/8] COPY web web                                                                              0.0s
     => CACHED [builder 5/8] COPY docs docs                                                                            0.0s
     => [builder 6/8] RUN --mount=type=cache,id=ragflow_npm,target=/root/.npm,sharing=locked     npm config set reg  118.1s
     => [builder 7/8] COPY .git /ragflow/.git                                                                          0.4s
     => [builder 8/8] RUN version_info=$(git describe --tags --match=v* --first-parent --always);     if [ "0" == "1"  0.4s
     => [production  2/16] COPY --from=builder /ragflow/.venv /ragflow/.venv                                         258.5s
     => [production  3/16] COPY web web                                                                                3.1s
     => [production  4/16] COPY api api                                                                                0.4s
     => [production  5/16] COPY conf conf                                                                              0.3s
     => [production  6/16] COPY deepdoc deepdoc                                                                        0.6s
     => [production  7/16] COPY rag rag                                                                                1.3s
     => [production  8/16] COPY agent agent                                                                            0.5s
     => [production  9/16] COPY graphrag graphrag                                                                      0.4s
     => [production 10/16] COPY agentic_reasoning agentic_reasoning                                                    0.4s
     => [production 11/16] COPY pyproject.toml uv.lock ./                                                              0.6s
     => [production 12/16] COPY docker/service_conf.yaml.template ./conf/service_conf.yaml.template                    0.4s
     => [production 13/16] COPY docker/entrypoint.sh docker/entrypoint-parser.sh ./                                    0.5s
     => [production 14/16] RUN chmod +x ./entrypoint*.sh                                                               1.2s
     => [production 15/16] COPY --from=builder /ragflow/web/dist /ragflow/web/dist                                     5.7s
     => [production 16/16] COPY --from=builder /ragflow/VERSION /ragflow/VERSION                                       0.4s
     => exporting to image                                                                                            61.9s
     => => exporting layers                                                                                           61.8s
     => => writing image sha256:d2b25a65a689b90064667869c1bf308634be66c11d11666c6aa4fb8d281d5fb1                       0.0s
     => => naming to docker.io/infiniflow/ragflow:nightly                                                              0.0s
    
    View build details: docker-desktop://dashboard/build/default/default/cnyvefqf3fr3ol2h3nyvsexxu
    
    What's Next?
      1. Sign in to your Docker account → docker login
      2. View a summary of image vulnerabilities and recommendations → docker scout quickview**
    

问题

  • build web的时候出现的问题
     => [builder 6/8] RUN --mount=type=cache,id=ragflow_npm,target=/root/.npm,sharing=locked     cd web && npm ins  1178.0s
     => => # Done in 629ms.
     => => # info  - [plugin: ./node_modules/@umijs/plugins/dist/tailwindcss] tailwindcss service exited
     => => # Browserslist: caniuse-lite is outdated. Please run:
     => => #   npx update-browserslist-db@latest
     => => #   Why you should do it regularly: https://github.com/browserslist/update-db#readme
     => => # ℹ Compiling Webpack
    ERROR: failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF
    
    看log似乎是被系统kill掉了,问了下deepseek,似乎是OOM。
    检查了下wsl的配置,发现分配的内存只有2G,修改下内存分配,至少得12G
    在这里插入图片描述

http://www.kler.cn/a/577604.html

相关文章:

  • MySQL语法总结
  • hadoop集群环境配置
  • 基于SpringBoot的“文物管理系统”的设计与实现(源码+数据库+文档+PPT)
  • Android双亲委派
  • PostgreSQL 如何有效地处理数据的加密和解密
  • Trae:引领未来的 AI 编程新时代
  • Kotlin D1
  • 你会测量管道液体流阻吗?西-魏斯巴赫方程(Darcy-Weisbach Equation)、Colebrook-White 方程帮你
  • 面试基础---高并发高可用架构下读写分离与数据分片如何设计
  • 装饰器模式--RequestWrapper、请求流request无法被重复读取
  • idea中隐藏目录
  • Go+eBPF kprobe 禁止运行指定程序
  • 芯麦GC4931P与A4931/Allegro在电机驱动应用中的对比与优势
  • C/C++蓝桥杯算法真题打卡(Day3)
  • 计算机毕业设计SpringBoot+Vue.js小区团购管理系统(源码+文档+PPT+讲解)
  • IDE集成开发环境MyEclipse中安装SVN
  • 1.12.信息系统的分类【ES】
  • 表格columns拼接两个后端返回的字段(以umi框架为例)
  • 基于Qwen-VL的手机智能体开发
  • Redis常问八股(一)