Docker deployment
Rules that apply to every container
- Mount
/etc/machine-idinto the container under the same path. - Mount a persistent host directory onto the SDK default data directory inside
the container. ONNX Runtime 1.22.1, managed provider runtimes, offline
license state, TensorRT caches, and OpenVINO caches all live there. On Linux
the default is
$XDG_CONFIG_HOME/denkflowif set, otherwise$HOME/.config/denkflow. The recipes run asroot, so they mount/root/.config/denkflow. - Use a glibc-based image such as Debian, Ubuntu, or an NVIDIA runtime image; Alpine is not supported.
- Set
DENKFLOW_NONINTERACTIVE=1for unattended startup. The first pipeline initialization downloads missing dependencies from the Hub. An offline container must instead receive the required.denkdependencyarchives in<data dir>/dependencies/or the dependency import directory.
You can still set DENKFLOW_DATA_DIRECTORY to a custom path if you prefer. It is not required when you mount at the default location.
All Python recipes below use the same build argument for the private package registry:
ARG DENKFLOW_PYPI_INDEX_URL=https://__token__:gldt-JCgXB7jPAo_b6JXAckFV@gitlab.com/api/v4/projects/69262737/packages/pypi/simple
That keeps PyPI available for public packages such as fastapi, pillow, and python-multipart while still letting pip resolve denkflow from the private registry.
Example run command (persistent data at the SDK default path for root):
docker run --rm -it \
-v /etc/machine-id:/etc/machine-id:ro \
-v /srv/denkflow-data:/root/.config/denkflow \
your-image:latest
Example build command:
docker build \
--build-arg DENKFLOW_PYPI_INDEX_URL="https://__token__:gldt-JCgXB7jPAo_b6JXAckFV@gitlab.com/api/v4/projects/69262737/packages/pypi/simple" \
-t your-image:latest .
Container 1: CPU-only Linux x86_64
FROM python:3.12-slim
ARG DENKFLOW_PYPI_INDEX_URL
ENV PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_EXTRA_INDEX_URL=${DENKFLOW_PYPI_INDEX_URL} \
DENKFLOW_NONINTERACTIVE=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libgomp1 \
&& rm -rf /var/lib/apt/lists/*
RUN python -m pip install --upgrade pip setuptools wheel \
&& python -m pip install denkflow
WORKDIR /app
There are no provider-specific Python extras. ONNX Runtime 1.22.1 is installed
by DENKflow on first use under
/root/.config/denkflow/dependencies/onnxruntime/, which is why the data-volume
mount is part of the runtime command rather than the image build.
Container 2: OpenVINO Linux x86_64
FROM python:3.12-slim
ARG DENKFLOW_PYPI_INDEX_URL
ENV PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_EXTRA_INDEX_URL=${DENKFLOW_PYPI_INDEX_URL} \
DENKFLOW_NONINTERACTIVE=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
libgomp1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
RUN python -m pip install --upgrade pip setuptools wheel \
&& python -m pip install denkflow
WORKDIR /app
Use this for Intel CPU deployments. It also works for Intel GPU and Intel NPU deployments if the host already provides the required Intel driver stack and you pass the needed devices into the container.
For Intel GPU and Intel NPU containers on Linux, you typically also need /dev/dri:
docker run --rm -it \
--device /dev/dri \
-v /etc/machine-id:/etc/machine-id:ro \
-v /srv/denkflow-data:/root/.config/denkflow \
your-openvino-image:latest
Container 3: CUDA Linux x86_64
FROM nvidia/cuda:12.6.1-cudnn-runtime-ubuntu22.04
ARG DENKFLOW_PYPI_INDEX_URL
ENV DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_EXTRA_INDEX_URL=${DENKFLOW_PYPI_INDEX_URL} \
DENKFLOW_NONINTERACTIVE=1
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
python3 \
python3-pip \
python3-venv \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade pip setuptools wheel \
&& python3 -m pip install denkflow
WORKDIR /app
The cudnn-runtime variant of the CUDA base image is required: ONNX Runtime's CUDA execution provider links against libcudnn.so.9, which the plain 12.6.1-runtime-ubuntu22.04 image does not contain.
Run it with the NVIDIA container runtime:
docker run --rm -it --gpus all \
-v /etc/machine-id:/etc/machine-id:ro \
-v /srv/denkflow-data:/root/.config/denkflow \
your-cuda-image:latest
Container 4: TensorRT Linux x86_64
FROM nvcr.io/nvidia/tensorrt:24.10-py3
ARG DENKFLOW_PYPI_INDEX_URL
ENV PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_EXTRA_INDEX_URL=${DENKFLOW_PYPI_INDEX_URL} \
DENKFLOW_NONINTERACTIVE=1
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libgomp1 \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade pip setuptools wheel \
&& python3 -m pip install denkflow
WORKDIR /app
Notes:
- When using TensorRT, the first model run can take significantly longer than subsequent ones
- Keep the cache volume persistent to avoid repeated rebuilds of the TensorRT cache
- This image provides a system TensorRT stack. DENKflow reuses it only when it is compatible with the release; otherwise first use installs the managed TensorRT dependency into the mounted data directory.
- If you change CPU architecture, adjust the
LD_PRELOADpath accordingly.
Container 5: Jetson Orin
FROM nvcr.io/nvidia/l4t-jetpack:r36.4.0
ARG DENKFLOW_PYPI_INDEX_URL
ENV PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_EXTRA_INDEX_URL=${DENKFLOW_PYPI_INDEX_URL} \
DENKFLOW_NONINTERACTIVE=1
ENV LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libstdc++.so.6
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
libgomp1 \
python3-pip \
python3-venv \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m pip install --upgrade pip setuptools wheel \
&& python3 -m pip install denkflow
WORKDIR /app
Use this as the preferred Jetson starting point for Orin-class devices. The
l4t-jetpack:r36.4.0 base image supplies the NVIDIA driver and JetPack
user-space integration. DENKflow installs ONNX Runtime 1.22.1 into the mounted
data directory and reuses compatible system CUDA/TensorRT libraries or installs
its managed runtime dependencies.
The LD_PRELOAD path uses the aarch64 multiarch directory of the
l4t-jetpack:r36.4.0 base image; adjust it if you change the base image.
Run it with the NVIDIA runtime on Jetson:
docker run --rm -it \
--runtime nvidia \
-v /etc/machine-id:/etc/machine-id:ro \
-v /srv/denkflow-data:/root/.config/denkflow \
your-jetson-image:latest