[Build] Fix Docker for Nuget_Test_Linux_GPU#26492
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the Docker base image from Ubuntu 20.04 to Ubuntu 24.04 for GPU package building and testing, ensuring compatibility with modern tooling and dependencies.
Key changes:
- Updated base image from
nvidia/cuda:12.8.1-cudnn-devel-ubuntu20.04tonvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04 - Improved Dockerfile best practices (cleanup, layer optimization, PEP 668 compliance)
- Updated Azure pipeline references to use the new Ubuntu 24.04 Dockerfile
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2404_gpu | Migrated from Ubuntu 20.04 to 24.04, consolidated package installation, added PEP 668 workaround, improved Docker layer cleanup |
| tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml | Updated references from Ubuntu 20.04 to 24.04 Dockerfile and base image |
Comments suppressed due to low confidence (2)
tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2404_gpu:32
- Removing the EXTERNALLY-MANAGED file bypasses PEP 668 protections designed to prevent conflicts between system packages and pip-installed packages. Consider using a Python virtual environment or installing packages with 'pip install --user' instead to avoid potential system instability.
tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2404_gpu:63 - The 'chown' operation on line 63 is redundant. The 'adduser' command on line 62 automatically creates the home directory with correct ownership for the new user.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
snnn
previously approved these changes
Nov 4, 2025
Contributor
snnn
left a comment
There was a problem hiding this comment.
Going forward we should consider using uv and uv's venv to manage dependencies, then we won't have this global pip installation problem.
Contributor
|
Example docker: |
snnn
reviewed
Nov 4, 2025
tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2404_gpu
Outdated
Show resolved
Hide resolved
snnn
approved these changes
Nov 5, 2025
Rohanjames1997
pushed a commit
to Rohanjames1997/onnxruntime
that referenced
this pull request
Dec 4, 2025
(1) Not install cudnn9-cuda-12 since the base image has cudnn so no need to install again. (2) Upgrade ubuntu to 24.04 This fixes the following error: ``` microsoft#11 315.1 cudnn9-cuda-12 : Depends: cudnn9-cuda-12-9 (>= 9.10.2.21) but it is not going to be installed microsoft#11 315.1 E: Unable to correct problems, you have held broken packages. ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(1) Not install cudnn9-cuda-12 since the base image has cudnn so no need to install again.
(2) Upgrade ubuntu to 24.04
This fixes the following error: