🏗️ Build and Push Images
Recommended unified build entry:
# Run interactive selection, similar to the deploy scripts
bash deploy/images/build.sh
# Build selected images with a fixed version tag
bash deploy/images/build.sh \
--images main,web,mcp,data-process,terminal \
--version v2.2.1 \
--registry general \
--platform linux/amd64,linux/arm64 \
--push
# Build the same image set as latest
bash deploy/images/build.sh \
--images main,web,mcp,data-process \
--version latest \
--registry general \
--platform linux/amd64 \
--load
# Build one or more explicit images when needed
bash deploy/images/build.sh --web --docs --version v2.2.1 --dry-runWhen run in a terminal without arguments, deploy/images/build.sh prompts for images, image version (latest or root VERSION), and registry. The interactive defaults are images main,web and version latest. Use --interactive to force the same prompts.
--platform is command-line only. Omit it to build for the local architecture.
Variant options:
--dependency-variant cpu|gpucontrols data-process dependencies and defaults tocpu.gpubuilds GPU/CUDA dependencies and uses the-gpuimage-name suffix.--terminal-variant slim|condacontrols the terminal image and defaults toslim.condakeeps Miniconda,vim, and the compiler toolchain and uses the-condaimage-name suffix.
When building data-process, deploy/images/build.sh prepares model-assets automatically: it first uses an existing root model-assets directory, then tries ~/model-assets, and otherwise clones the Hugging Face repository and runs git lfs pull. If you run docker build directly, prepare model-assets in the repository root first.
Image options:
--mainbuildsnexent--webbuildsnexent-web--data-processbuildsnexent-data-process--mcpbuildsnexent-mcp--terminalbuildsnexent-ubuntu-terminal--docsbuildsnexent-docs
# 🛠️ Create and use a new builder instance that supports multi-architecture builds
docker buildx create --name nexent_builder --use
# 🚀 build application for multiple architectures
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent -f deploy/images/dockerfiles/main/Dockerfile . --push
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t ccr.ccs.tencentyun.com/nexent-hub/nexent -f deploy/images/dockerfiles/web/Dockerfile . --push
# 📊 build data_process for multiple architectures
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-data-process -f deploy/images/dockerfiles/data-process/Dockerfile . --push
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process -f deploy/images/dockerfiles/web/Dockerfile . --push
# 🌐 build web frontend for multiple architectures
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-web -f deploy/images/dockerfiles/web/Dockerfile . --push
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t ccr.ccs.tencentyun.com/nexent-hub/nexent-web -f deploy/images/dockerfiles/web/Dockerfile . --push
# 📚 build documentation for multiple architectures
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-docs -f deploy/images/dockerfiles/docs/Dockerfile . --push
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t ccr.ccs.tencentyun.com/nexent-hub/nexent-docs -f deploy/images/dockerfiles/docs/Dockerfile . --push
# 🔗 build MCP Server for multiple architectures
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-mcp -f deploy/images/dockerfiles/mcp/Dockerfile . --push
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp -f deploy/images/dockerfiles/mcp/Dockerfile . --push
# 💻 build Ubuntu Terminal for multiple architectures
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t nexent/nexent-terminal -f deploy/images/dockerfiles/terminal/Dockerfile . --push
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -t ccr.ccs.tencentyun.com/nexent-hub/nexent-terminal -f deploy/images/dockerfiles/terminal/Dockerfile . --push💻 Local Development Build
# 🚀 Build application image (current architecture only)
docker build --progress=plain -t nexent/nexent -f deploy/images/dockerfiles/main/Dockerfile .
# 📊 Build data process image (current architecture only)
docker build --progress=plain -t nexent/nexent-data-process -f deploy/images/dockerfiles/data-process/Dockerfile .
# 📊 Build GPU data process image (current architecture only)
docker build --progress=plain -t nexent/nexent-data-process-gpu -f deploy/images/dockerfiles/data-process/Dockerfile --build-arg DATA_PROCESS_DEPENDENCY_VARIANT=gpu .
# 🌐 Build web frontend image (current architecture only)
docker build --progress=plain -t nexent/nexent-web -f deploy/images/dockerfiles/web/Dockerfile .
# 📚 Build documentation image (current architecture only)
docker build --progress=plain -t nexent/nexent-docs -f deploy/images/dockerfiles/docs/Dockerfile .
# 🔗 Build MCP Server image (current architecture only)
docker build --progress=plain -t nexent/nexent-mcp -f deploy/images/dockerfiles/mcp/Dockerfile .
# 💻 Build OpenSSH Server image (current architecture only)
docker build --progress=plain -t nexent/nexent-ubuntu-terminal -f deploy/images/dockerfiles/terminal/Dockerfile .
# 💻 Build OpenSSH Server image with Conda (current architecture only)
docker build --progress=plain -t nexent/nexent-ubuntu-terminal-conda -f deploy/images/dockerfiles/terminal/Dockerfile --build-arg TERMINAL_VARIANT=conda .🧹 Clean up Docker resources
# 🧼 Clean up Docker build cache and unused resources
docker builder prune -f && docker system prune -f🔧 Image Descriptions
Main Application Image (nexent/nexent)
- Contains backend API service
- Built from
deploy/images/dockerfiles/main/Dockerfile - Provides core agent services
Data Processing Image (nexent/nexent-data-process)
- Contains data processing service
- Built from
deploy/images/dockerfiles/data-process/Dockerfile - Handles document parsing and vectorization
Web Frontend Image (nexent/nexent-web)
- Contains Next.js frontend application
- Built from
deploy/images/dockerfiles/web/Dockerfile - Provides user interface
Documentation Image (nexent/nexent-docs)
- Contains Vitepress documentation site
- Built from
deploy/images/dockerfiles/docs/Dockerfile - Provides project documentation and API reference
MCP Server Image (nexent/nexent-mcp)
- Contains MCP (Model Context Protocol) proxy service
- Built from
deploy/images/dockerfiles/mcp/Dockerfile - Provides MCP server functionality for AI model integration
Pre-installed Tools and Features
- Python Environment: Python 3.11 + pip
- MCP Proxy: mcp-proxy package for protocol handling
- Node.js: Node.js 20.17.0 with npm
- Architecture Support: linux/amd64, linux/arm64
- Base Image: python:3.11-slim
OpenSSH Server Image (nexent/nexent-ubuntu-terminal)
- Ubuntu 24.04-based SSH server container
- Built from
deploy/images/dockerfiles/terminal/Dockerfile - Defaults to OpenSSH, Python, pip, venv, Git, Curl, and Wget
TERMINAL_VARIANT=condaalso installs Miniconda, Vim, and the compiler toolchain- Runs as root and allows root login with password authentication
Pre-installed Tools and Features
- Python Environment: Python 3 + pip + venv
- Conda Management: Miniconda3 is included only in the
condavariant - Development Tools: Git, Curl, Wget; the
condavariant also includes Vim and build-essential - SSH Service: Container port 22, root login and password authentication enabled
🏷️ Tagging Strategy
Each image is pushed to two repositories:
nexent/*- Main public image repositoryccr.ccs.tencentyun.com/nexent-hub/*- Tencent Cloud image repository (China region acceleration)
All images include:
nexent/nexent- Main application backend servicenexent/nexent-data-process- Data processing servicenexent/nexent-web- Next.js frontend applicationnexent/nexent-docs- Vitepress documentation sitenexent/nexent-mcp- MCP server proxy servicenexent/nexent-ubuntu-terminal- OpenSSH development server container
📚 Documentation Image Standalone Deployment
The documentation image can be built and run independently to serve nexent.tech/doc:
Build Documentation Image
docker build -t nexent/nexent-docs -f deploy/images/dockerfiles/docs/Dockerfile .Run Documentation Container
docker run -d --name nexent-docs -p 4173:4173 nexent/nexent-docsCheck Container Status
docker psView Container Logs
docker logs nexent-docsStop and Remove Container
docker stop nexent-docsdocker rm nexent-docsNotes:
- 🔧 Use
--platform linux/amd64,linux/arm64to specify target architectures - 📤 The
--pushflag automatically pushes the built images to Docker Hub - 🔑 Make sure you are logged in to Docker Hub (
docker login) - ⚠️ If you encounter build errors, ensure Docker's buildx feature is enabled
- 🧹 Cleanup commands explanation:
docker builder prune -f: Cleans build cachedocker system prune -f: Cleans unused data (including dangling images, networks, etc.)- The
-fflag forces execution without confirmation
- 🔧 The
--loadflag loads the built image into the local Docker images list - ⚠️
--loadcan only be used with single architecture builds - 📝 Use
docker imagesto verify the images are loaded locally - 📊 Use
--progress=plainto see detailed build and push progress - 📈 Use
--build-arg MIRROR=...to set up a pip mirror to accelerate your build-up progress
🚀 Deployment Recommendations
After building is complete, you can deploy local images from the repository root:
bash deploy.sh docker --image-source local-latest
local-latestuses locallatestNexent application images and avoids pulling those images again. You do not need to modifydeploy/docker/deploy.sh.
Package Local Images for Offline Deployment
After building local latest images, package them with the offline builder:
bash deploy/offline/build_offline_package.sh \
--target docker \
--version latest \
--platform amd64 \
--components infrastructure,application,data-process,supabase \
--image-source local-latest \
--compress true \
--output-dir offline-package/docker-localWhen --version latest or --image-source local-latest is used, the builder expects local Nexent application images and skips pulling those latest tags. The package can then be moved to another host and deployed with:
cd offline-package/docker-local
bash deploy.sh --load-images docker \
--version latest \
--components infrastructure,application,data-process,supabase \
--image-source local-latest