Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Environment:Triton inference server Server Docker Container Build

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Containerization
Last Updated 2026-02-13 17:00 GMT

Overview

Docker-based build environment for constructing custom Triton Inference Server container images using build.py and compose.py build scripts.

Description

This environment defines the prerequisites for building Triton Inference Server from source or composing custom container images. The build system uses a multi-stage Docker build process. build.py compiles the server from source while compose.py assembles pre-built components from NGC images into a custom container. Both scripts require Docker with NVIDIA Container Toolkit and specific Python dependencies (distro, requests).

The build system automatically detects the target platform (Linux, RHEL, Windows, macOS) and architecture (x86_64, aarch64) to configure the appropriate build flags and base images.

Usage

Use this environment when building custom Triton containers with specific backend selections, or when compiling Triton from source for development or custom deployment. The compose.py script is the recommended path for most users who need a container with a specific subset of backends.

System Requirements

Category Requirement Notes
OS Linux (Ubuntu 22.04+), RHEL 8+, or Windows 10+ macOS/darwin for development builds only
Docker Docker 20.10+ with BuildKit NVIDIA Container Toolkit required for GPU support
Python Python 3.10+ Build scripts require distro and requests packages
CMake CMake 3.31.8+ Required for source builds; pip install cmake==4.0.3 in container
C++ C++17 or later TRITON_MIN_CXX_STANDARD=17
Disk 50GB+ SSD Source build generates many intermediate artifacts
RAM 16GB+ Compilation is memory-intensive

Dependencies

System Packages

  • Docker Engine with BuildKit support
  • NVIDIA Container Toolkit (for GPU builds)
  • Git (for cloning repositories)

Python Packages

  • distro (OS distribution detection)
  • requests (HTTP requests for downloading components)
  • importlib.util (dynamic module loading for backend build scripts)

Build Tools (inside container)

  • CMake >= 3.31.8
  • GCC/G++ or MSVC (C++17 support required)
  • ccache (optional, for build caching via CCACHE_REMOTE_ONLY)

Third-Party Libraries (fetched by CMake)

  • triton-core (Triton core library)
  • protobuf (protocol buffer support)
  • googletest (testing framework)
  • re2 (regular expressions)
  • libevent / libevhtp (HTTP endpoint, conditional)
  • grpc (gRPC endpoint, conditional)
  • opentelemetry-cpp (tracing, conditional, Linux only)
  • google-cloud-cpp (GCS storage, conditional)
  • aws-sdk-cpp (S3 storage, conditional)

Credentials

  • CCACHE_REMOTE_STORAGE: Remote ccache storage URL (optional, for build caching)

Quick Install

# Clone the repository
git clone https://github.com/triton-inference-server/server.git
cd server

# Build with compose.py (recommended for custom containers)
pip install docker
python3 compose.py --backend tensorrt --backend python --backend onnxruntime

# Build from source with build.py
pip install distro requests
python3 build.py --enable-gpu --backend=ensemble --backend=tensorrt

Code Evidence

CMake minimum version from CMakeLists.txt:27:

cmake_minimum_required(VERSION 3.31.8)

C++ standard requirement from CMakeLists.txt:34:

set(TRITON_MIN_CXX_STANDARD 17 CACHE STRING
    "The minimum C++ standard which features are requested to build this target.")

Platform detection from build.py:120-140:

def target_platform():
    # Returns: "linux", "rhel", "windows", "darwin"
    if FLAGS.target_platform is not None:
        return FLAGS.target_platform
    pf = platform.system().lower()
    ...

Version mapping from build.py:73-83:

DEFAULT_TRITON_VERSION_MAP = {
    "release_version": "2.67.0dev",
    "triton_container_version": "26.03dev",
    "upstream_container_version": "26.01",
    "ort_version": "1.24.1",
    "ort_openvino_version": "2025.4.1",
    "standalone_openvino_version": "2025.4.1",
    "dcgm_version": "4.5.2-1",
    "vllm_version": "0.13.0",
    "rhel_py_version": "3.12.3",
}

OpenVINO version matching requirement from build.py:67-70:

# Currently the OpenVINO versions used in ORT and standalone must
# match because of the way dlopen works with loading the backends. If
# different versions are used then one backend or the other will
# incorrectly load the other version of the openvino libraries.

Common Errors

Error Message Cause Solution
cmake_minimum_required VERSION 3.31.8 CMake version too old pip install cmake==4.0.3 or install CMake 3.31.8+
No module named distro Missing Python dependency pip install distro
CUDA_VERSION not found in container GPU container missing CUDA Use correct NGC base image with CUDA pre-installed
OpenVINO version mismatch between ORT and standalone dlopen loads wrong library version Ensure ort_openvino_version and standalone_openvino_version match in build config

Compatibility Notes

  • Windows builds: Use Dockerfile.win10.min with Visual Studio 2022 Build Tools. OpenTelemetry is not supported. MSVC compiler flags include /W1 /D_WIN32_WINNT=0x0A00 /EHsc /Zc:preprocessor.
  • RHEL builds: Libraries install to lib64. Python version defaults to 3.12.3. TorchTRT and OpenVINO extensions not yet supported for manylinux builds.
  • Compose vs Build: compose.py assembles pre-built components (faster), while build.py compiles from source (more flexible). Use compose.py for selecting specific backends from existing NGC images.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment