Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#21675 FROM pytorch/pytorch:2.8.0-cuda12.8-cudnn9-runtime

Merged
Ghost merged 1 commits into Ultralytics:main from ultralytics:glenn-jocher-patch-1
4 changed files with 25 additions and 18 deletions
  1. 5
    5
      .github/workflows/docker.yml
  2. 4
    8
      docker/Dockerfile
  3. 15
    0
      docker/Dockerfile-export
  4. 1
    5
      docker/Dockerfile-runner
@@ -17,7 +17,7 @@ on:
     inputs:
     inputs:
       Dockerfile:
       Dockerfile:
         type: boolean
         type: boolean
-        description: Dockerfile (+ runner)
+        description: Dockerfile (+ runner, export)
         default: true
         default: true
       Dockerfile-python:
       Dockerfile-python:
         type: boolean
         type: boolean
@@ -61,7 +61,7 @@ jobs:
             tags: "latest"
             tags: "latest"
             platforms: "linux/amd64"
             platforms: "linux/amd64"
             runs_on: "ubuntu-latest"
             runs_on: "ubuntu-latest"
-            derivatives: "Dockerfile-runner"
+            derivatives: "Dockerfile-runner,Dockerfile-export"
           - dockerfile: "Dockerfile-python"
           - dockerfile: "Dockerfile-python"
             tags: "latest-python"
             tags: "latest-python"
             platforms: "linux/amd64"
             platforms: "linux/amd64"
@@ -210,15 +210,15 @@ jobs:
 
 
       - name: Check Environment
       - name: Check Environment
         if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && (matrix.platforms == 'linux/amd64' || matrix.platforms == 'linux/arm64') && matrix.dockerfile != 'Dockerfile-conda'
         if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && (matrix.platforms == 'linux/amd64' || matrix.platforms == 'linux/arm64') && matrix.dockerfile != 'Dockerfile-conda'
-        run: docker run ultralytics/ultralytics:${{ matrix.tags == 'latest-python' && 'latest-python-export' || matrix.tags }} /bin/bash -c "yolo checks && uv pip list"
+        run: docker run ultralytics/ultralytics:${{ (matrix.tags == 'latest-python' && 'latest-python-export') || (matrix.tags == 'latest' && 'latest-export') || matrix.tags }} /bin/bash -c "yolo checks && uv pip list"
 
 
       - name: Run Tests
       - name: Run Tests
         if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && (matrix.platforms == 'linux/amd64' || matrix.platforms == 'linux/arm64') && matrix.dockerfile != 'Dockerfile-conda'
         if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && (matrix.platforms == 'linux/amd64' || matrix.platforms == 'linux/arm64') && matrix.dockerfile != 'Dockerfile-conda'
-        run: docker run ultralytics/ultralytics:${{ matrix.tags == 'latest-python' && 'latest-python-export' || matrix.tags }} /bin/bash -c "pip install pytest && pytest tests"
+        run: docker run ultralytics/ultralytics:${{ (matrix.tags == 'latest-python' && 'latest-python-export') || (matrix.tags == 'latest' && 'latest-export') || matrix.tags }} /bin/bash -c "pip install pytest && pytest tests"
 
 
       - name: Run Benchmarks
       - name: Run Benchmarks
         if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && (matrix.platforms == 'linux/amd64' || matrix.dockerfile == 'Dockerfile-arm64') && matrix.dockerfile != 'Dockerfile' && matrix.dockerfile != 'Dockerfile-conda'
         if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && (matrix.platforms == 'linux/amd64' || matrix.dockerfile == 'Dockerfile-arm64') && matrix.dockerfile != 'Dockerfile' && matrix.dockerfile != 'Dockerfile-conda'
-        run: docker run ultralytics/ultralytics:${{ matrix.tags == 'latest-python' && 'latest-python-export' || matrix.tags }} yolo benchmark model=yolo11n.pt imgsz=160 verbose=0.309
+        run: docker run ultralytics/ultralytics:${{ (matrix.tags == 'latest-python' && 'latest-python-export') || (matrix.tags == 'latest' && 'latest-export') || matrix.tags }} yolo benchmark model=yolo11n.pt imgsz=160 verbose=0.309
 
 
       - name: Push All Images
       - name: Push All Images
         if: github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')
         if: github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')
Discard
@@ -4,7 +4,7 @@
 # Image is CUDA-optimized for YOLO single/multi-GPU training and inference
 # Image is CUDA-optimized for YOLO single/multi-GPU training and inference
 
 
 # Start FROM PyTorch image https://hub.docker.com/r/pytorch/pytorch or nvcr.io/nvidia/pytorch:25.02-py3
 # Start FROM PyTorch image https://hub.docker.com/r/pytorch/pytorch or nvcr.io/nvidia/pytorch:25.02-py3
-FROM pytorch/pytorch:2.7.0-cuda12.6-cudnn9-runtime
+FROM pytorch/pytorch:2.8.0-cuda12.8-cudnn9-runtime
 
 
 # Set environment variables
 # Set environment variables
 # Avoid DDP error "MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library"
 # Avoid DDP error "MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library"
@@ -40,14 +40,10 @@ RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \
     sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
     sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml
 ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
 ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
 
 
-# Install pip packages and run exports to AutoInstall packages
+# Install pip packages
 RUN pip install uv && \
 RUN pip install uv && \
-    uv pip install --system -e ".[export]" albumentations faster-coco-eval "onnxruntime-gpu" tensorrt wandb && \
-    # Run exports to AutoInstall packages
-    yolo export model=tmp/yolo11n.pt format=edgetpu imgsz=32 && \
-    yolo export model=tmp/yolo11n.pt format=ncnn imgsz=32 && \
-    uv pip install --system paddlepaddle x2paddle && \
-    # Remove extra build files
+    uv pip install --system -e "." albumentations faster-coco-eval wandb && \
+    # Remove extra build files \
     rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
     rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
 
 
 # Usage Examples -------------------------------------------------------------------------------------------------------
 # Usage Examples -------------------------------------------------------------------------------------------------------
Discard
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  1. # Ultralytics ๐Ÿš€ AGPL-3.0 License - https://ultralytics.com/license
  2. # Export-optimized derivative of ultralytics/ultralytics:latest for testing and benchmarks
  3. # Includes all export format dependencies and pre-installed export packages
  4. FROM ultralytics/ultralytics:latest
  5. # Install export dependencies and run exports to AutoInstall packages
  6. # Numpy 1.26.4 required due to TF export bug with torch 2.8
  7. RUN uv pip install --system -e ".[export]" "onnxruntime-gpu" tensorrt paddlepaddle x2paddle numpy==1.26.4 && \
  8. # Run exports to AutoInstall packages \
  9. yolo export model=yolo11n.pt format=edgetpu imgsz=32 && \
  10. yolo export model=yolo11n.pt format=ncnn imgsz=32 && \
  11. # Remove temporary files \
  12. rm -rf tmp /root/.config/Ultralytics/persistent_cache.json
Discard
@@ -7,11 +7,7 @@
 FROM ultralytics/ultralytics:latest
 FROM ultralytics/ultralytics:latest
 
 
 # Set additional environment variables for runner
 # Set additional environment variables for runner
-ENV PYTHONUNBUFFERED=1 \
-    PYTHONDONTWRITEBYTECODE=1 \
-    PIP_NO_CACHE_DIR=1 \
-    PIP_BREAK_SYSTEM_PACKAGES=1 \
-    RUNNER_ALLOW_RUNASROOT=1 \
+ENV RUNNER_ALLOW_RUNASROOT=1 \
     DEBIAN_FRONTEND=noninteractive
     DEBIAN_FRONTEND=noninteractive
 
 
 # Set the working directory
 # Set the working directory
Discard