Common base container images for Open Data Hub (ODH) workloads.
This repository provides standardized Containerfiles for building ODH midstream base images. These images serve as the foundation for AI/ML workloads in OpenShift AI.
Why base images? See docs/RATIONALE.md for the motivation behind this project. For development setup and workflow, see docs/DEVELOPMENT.md.
| Type | Versions | Base OS |
|---|---|---|
| Python | 3.12 | UBI 9 |
| CUDA | 12.8, 12.9, 13.0, 13.1 | CentOS Stream 9 |
The ODH base images are published to quay.io/opendatahub and ready to use.
| Version | Image | Quay.io Repository |
|---|---|---|
| 3.12 | quay.io/opendatahub/odh-midstream-python-base-3-12 |
View on Quay.io |
# Pull Python 3.12 base image
podman pull quay.io/opendatahub/odh-midstream-python-base-3-12| Version | Image | Quay.io Repository |
|---|---|---|
| 12.8 | quay.io/opendatahub/odh-midstream-cuda-base-12-8 |
View on Quay.io |
| 12.9 | quay.io/opendatahub/odh-midstream-cuda-base-12-9 |
View on Quay.io |
| 13.0 | quay.io/opendatahub/odh-midstream-cuda-base-13-0 |
View on Quay.io |
| 13.1 | quay.io/opendatahub/odh-midstream-cuda-base-13-1 |
View on Quay.io |
# Pull CUDA 12.8 base image
podman pull quay.io/opendatahub/odh-midstream-cuda-base-12-8
# Pull CUDA 13.1 base image
podman pull quay.io/opendatahub/odh-midstream-cuda-base-13-1Each image type has version-specific directories containing a Containerfile and app.conf:
cuda/<version>/Containerfile # CUDA image definition
cuda/<version>/app.conf # CUDA build arguments
python/<version>/Containerfile # Python image definition
python/<version>/app.conf # Python build arguments
# Build a specific version
./scripts/build.sh <type>-<version> # e.g., cuda-12.8, python-3.12
# Build all versions of a type
./scripts/build.sh <type> # e.g., cuda, python
# Build everything
./scripts/build.sh all
# Show available versions and help
./scripts/build.sh --help# Generic pattern
podman build -t <image-name>:<tag> \
--build-arg-file <type>/<version>/app.conf \
-f <type>/<version>/Containerfile .
# Example: Build CUDA 12.8
podman build -t odh-midstream-cuda-base:12.8-py312 \
--build-arg-file cuda/12.8/app.conf \
-f cuda/12.8/Containerfile .| Template | Base | Reason |
|---|---|---|
| Python (CPU) | UBI 9 | Smaller footprint, Red Hat supported |
| CUDA (GPU) | CentOS Stream 9 | CUDA requires OpenGL/mesa libs not in UBI 9 |
Note:
- CUDA packages fail on UBI 9 due to missing dependencies (OpenGL, mesa libs). CentOS Stream 9 includes these libraries.
- Python images remain on UBI 9 to minimize migration impact. A unified CentOS Stream 9 base for all images may be considered in the future.
Both images share consistent configuration:
| Property | Value |
|---|---|
| User ID | 1001 |
| Group ID | 0 (root group) |
| Workdir | /opt/app-root/src |
| OpenShift SCC | restricted compatible |
FROM quay.io/opendatahub/odh-midstream-python-base-3-12
# pip and uv are pre-configured with package indexes
COPY requirements.txt .
RUN pip install -r requirements.txt
# Or use uv (faster): RUN uv pip install -r requirements.txt
COPY --chown=1001:0 . .
CMD ["python", "app.py"]FROM quay.io/opendatahub/odh-midstream-cuda-base-12-8
# pip and uv are pre-configured with PyPI + PyTorch CUDA indexes
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY --chown=1001:0 . .
CMD ["python", "train.py"]Use the generation script to create a new version from the template:
# Generate Containerfile from template
./scripts/generate-containerfile.sh <type> <version>
# Example: Add CUDA 13.2
./scripts/generate-containerfile.sh cuda 13.2
# Then create cuda/13.2/app.conf with version-specific values
# Include CUDA_MAJOR, CUDA_MAJOR_MINOR, CUDA_MAJOR_MINOR_DOT
# Get versions from: https://gitlab.com/nvidia/container-images/cuda/-/tree/master/dist
# Example: Add Python 3.13
./scripts/generate-containerfile.sh python 3.13
# Then create python/3.13/app.conf with version-specific values
# Include PYTHON_VERSION and PYTHON_VERSION_NODOTBuild arguments are defined in <type>/<version>/app.conf files. The build script passes these directly via --build-arg-file.
To update package versions:
# Edit the config file
vim <type>/<version>/app.conf
# Rebuild the image
./scripts/build.sh <type>-<version>Images will be built using Konflux pipelines.
Apache License 2.0 - See LICENSE for details.