You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build_docker_image.md 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ---
  2. sidebar_position: 1
  3. slug: /build_docker_image
  4. ---
  5. # Build a RAGFlow Docker Image
  6. A guide explaining how to build a RAGFlow Docker image from its source code. By following this guide, you'll be able to create a local Docker image that can be used for development, debugging, or testing purposes.
  7. ## Target Audience
  8. - Developers who have added new features or modified the existing code and require a Docker image to view and debug their changes.
  9. - Testers looking to explore the latest features of RAGFlow in a Docker image.
  10. ## Prerequisites
  11. - CPU ≥ 4 cores
  12. - RAM ≥ 16 GB
  13. - Disk ≥ 50 GB
  14. - Docker ≥ 24.0.0 & Docker Compose ≥ v2.26.1
  15. :::tip NOTE
  16. If you have not installed Docker on your local machine (Windows, Mac, or Linux), see the [Install Docker Engine](https://docs.docker.com/engine/install/) guide.
  17. :::
  18. ## Build a RAGFlow Docker Image
  19. To build a RAGFlow Docker image from source code:
  20. ### Git Clone the Repository
  21. ```bash
  22. git clone https://github.com/infiniflow/ragflow.git
  23. cd ragflow
  24. ```
  25. ### Build the Docker Image
  26. Navigate to the `ragflow` directory where the Dockerfile and other necessary files are located. Now you can build the Docker image using the provided Dockerfile. The command below specifies which Dockerfile to use and tags the image with a name for reference purpose.
  27. #### Build and push multi-arch image `infiniflow/ragflow:dev-slim`
  28. On a `linux/amd64` host:
  29. ```bash
  30. docker build -f Dockerfile.slim -t infiniflow/ragflow:dev-slim-amd64 .
  31. docker push infiniflow/ragflow:dev-slim-amd64
  32. ```
  33. On a `linux/arm64` host:
  34. ```bash
  35. docker build -f Dockerfile.slim -t infiniflow/ragflow:dev-slim-arm64 .
  36. docker push infiniflow/ragflow:dev-slim-arm64
  37. ```
  38. On a Linux host:
  39. ```bash
  40. docker manifest create infiniflow/ragflow:dev-slim --amend infiniflow/ragflow:dev-slim-amd64 --amend infiniflow/ragflow:dev-slim-arm64
  41. docker manifest push infiniflow/ragflow:dev-slim
  42. ```
  43. This image is approximately 1 GB in size and relies on external LLM services, as it does not include deepdoc, embedding, or chat models.
  44. #### Build and push multi-arch image `infiniflow/ragflow:dev`
  45. On a `linux/amd64` host:
  46. ```bash
  47. pip3 install huggingface-hub
  48. python3 download_deps.py
  49. docker build -f Dockerfile -t infiniflow/ragflow:dev-amd64 .
  50. docker push infiniflow/ragflow:dev-amd64
  51. ```
  52. On a `linux/arm64` host:
  53. ```bash
  54. pip3 install huggingface-hub
  55. python3 download_deps.py
  56. docker build -f Dockerfile -t infiniflow/ragflow:dev-arm64 .
  57. docker push infiniflow/ragflow:dev-arm64
  58. ```
  59. On any linux host:
  60. ```bash
  61. docker manifest create infiniflow/ragflow:dev --amend infiniflow/ragflow:dev-amd64 --amend infiniflow/ragflow:dev-arm64
  62. docker manifest push infiniflow/ragflow:dev
  63. ```
  64. This image's size is approximately 9 GB in size and can reference via either local CPU/GPU or an external LLM, as it includes deepdoc, embedding, and chat models.