DeepDetect Docker images

June 25, 2026 ยท View on GitHub

Installation

See https://github.com/jolibrain/deepdetect/tree/master/docs/docker.md

Build

Dockerfiles are stored in the "docker" folder, but you must launch build from root directory.

We choose to prefix Dockerfiles with target architecture :

  • cpu.Dockerfile
  • cpu-armv7.Dockerfile
  • gpu.Dockerfile

Build script

Build script is available in docker path : build/build.sh

Docker build-arg : DEEPDETECT_BUILD

Description : DEEPDETECT_BUILD build argument change cmake arguments in build.sh script.

Expected values :

  • CPU
    • default
    • armv7
  • GPU
    • default
    • tensorrt

Prepare build environment

Create build directory and put build script inside :

mkdir build
cd build
cp -a ../build.sh .

Launch build with environments variables

DEEPDETECT_ARCH=cpu DEEPDETECT_BUILD=default,armv7 ./build.sh
DEEPDETECT_ARCH=gpu DEEPDETECT_BUILD=default,tensorrt ./build.sh

Launch build with build script parameters

Params usage: ./build.sh [options...]

   -a, --deepdetect-arch          Choose Deepdetect architecture : cpu,gpu
   -b, --deepdetect-build         Choose Deepdetect build profile : CPU (default,armv7) / GPU (default,tensorrt)

Building an image

Docker build arguments

  • DEEPDETECT_BUILD : Change cmake arguments, checkout build script documentation.
  • DEEPDETECT_DEFAULT_MODELS : [true/false] Enable or disable default models in deepdetect docker image. Default models size is about 160MB.
  • USE_PREBUILT_TORCH : [ON/OFF] Use official prebuilt PyTorch/LibTorch packages for Torch builds. Set to OFF only to restore the slower source-built PyTorch path.
  • PYTORCH_CUDA_INDEX : GPU-only PyTorch wheel index. Defaults to cu130; use cu126 with DEEPDETECT_GPU_VARIANT=legacy61.
  • DEEPDETECT_GPU_VARIANT : [default/legacy61] GPU-only arch preset. default targets CUDA 13 and compute capabilities 7.5;8.0;8.6;8.9;9.0;10.0;12.0. legacy61 targets CUDA 12.x and preserves older compute capabilities 6.1;6.2;7.0;7.2;7.5;8.0;8.6;8.9;9.0.
  • DD_CUDA_VERSION / DD_CUDA_MAJOR_MINOR : Optional CUDA image overrides. The defaults are CUDA 13.0.2 / 13.0; use CUDA 12.6.3 / 12.6 with DEEPDETECT_GPU_VARIANT=legacy61.

Docker Torch builds install torch==2.12.1 and torchvision==0.27.1 in the build stage and configure DeepDetect with USE_PREBUILT_TORCH=ON. Runtime images copy the native Torch, torchvision, and NVIDIA wheel libraries needed by DeepDetect; the Python Torch package is not installed in the runtime stage.

Build examples

You must launch build from root directory

Example with CPU image:

# Build with default cmake
export DOCKER_BUILDKIT=1
docker build -t jolibrain/deepdetect_cpu --no-cache -f docker/cpu.Dockerfile .

# Build with default cmake and without default models
export DOCKER_BUILDKIT=1
docker build --build-arg DEEPDETECT_DEFAULT_MODELS=false -t jolibrain/deepdetect_cpu --no-cache -f cpu.Dockerfile .

Example with CPU (armv7) image:

# Build with default cmake
export DOCKER_BUILDKIT=1
docker build -t jolibrain/deepdetect_cpu:armv7 --no-cache -f docker/cpu-armv7.Dockerfile .

Example with GPU image:

# Build with default cmake
export DOCKER_BUILDKIT=1
docker build -t jolibrain/deepdetect_gpu --no-cache -f docker/gpu.Dockerfile .

# Build with default cmake and without default models
export DOCKER_BUILDKIT=1
docker build --build-arg DEEPDETECT_DEFAULT_MODELS=false -t jolibrain/deepdetect_gpu --no-cache -f docker/gpu.Dockerfile .

# Build the legacy61 compatibility alias
export DOCKER_BUILDKIT=1
docker build \
  --build-arg DEEPDETECT_GPU_VARIANT=legacy61 \
  --build-arg DD_CUDA_VERSION=12.6.3 \
  --build-arg DD_CUDA_MAJOR_MINOR=12.6 \
  --build-arg PYTORCH_CUDA_INDEX=cu126 \
  -t jolibrain/deepdetect_gpu:legacy61 \
  --no-cache \
  -f docker/gpu.Dockerfile .

# Same legacy61 build through the helper wrapper
export DOCKER_BUILDKIT=1
./ci/build-docker-images.sh gpu_legacy61