Skip to content

Add OCI standard image labels - #970

Open
karthikvetrivel wants to merge 1 commit into
mainfrom
add-oci-image-labels
Open

Add OCI standard image labels#970
karthikvetrivel wants to merge 1 commit into
mainfrom
add-oci-image-labels

Conversation

@karthikvetrivel

@karthikvetrivel karthikvetrivel commented Aug 13, 2026

Copy link
Copy Markdown
Member

This PR adds well-known OCI Image labels to the gpu-driver-container image metadata.

Before

$ docker inspect --format='{{json .Config.Labels}}' nvcr.io/nvidia/driver:580.95.05-ubuntu24.04 | jq
{
  "org.opencontainers.image.ref.name": "ubuntu",
  "org.opencontainers.image.version": "24.04"
}

After — ubuntu24.04 image built from this branch

$ docker inspect --format='{{json .Config.Labels}}' nvidia/driver:580.178.04-ubuntu24.04 | jq
{
  "description": "Provision the NVIDIA driver through containers",
  "io.k8s.display-name": "NVIDIA Driver Container",
  "name": "NVIDIA Driver Container",
  "org.opencontainers.image.base.name": "docker.io/library/ubuntu",
  "org.opencontainers.image.created": "2026-08-17T20:08:27Z",
  "org.opencontainers.image.description": "Provision the NVIDIA driver through containers",
  "org.opencontainers.image.documentation": "https://docs.nvidia.com/datacenter/cloud-native/gpu-operator",
  "org.opencontainers.image.revision": "181ac401f19e34000eb87ddb041a6ba99125e23b",
  "org.opencontainers.image.source": "https://github.com/NVIDIA/gpu-driver-container.git",
  "org.opencontainers.image.title": "NVIDIA Driver Container",
  "org.opencontainers.image.url": "https://catalog.ngc.nvidia.com/orgs/nvidia/containers/driver",
  "org.opencontainers.image.vendor": "NVIDIA",
  "org.opencontainers.image.version": "580.178.04-ubuntu24.04",
  "release": "N/A",
  "summary": "Provision the NVIDIA driver through containers",
  "vcs-ref": "181ac401f19e34000eb87ddb041a6ba99125e23b",
  "vendor": "NVIDIA",
  "version": "580.178.04"
}

@karthikvetrivel
karthikvetrivel marked this pull request as ready for review August 13, 2026 21:28
Comment thread rhel10/precompiled/Dockerfile
@rahulait

Copy link
Copy Markdown
Contributor

@karthikvetrivel can we update the PR description. We can get this merged today and add to next release.

@karthikvetrivel
karthikvetrivel force-pushed the add-oci-image-labels branch 2 times, most recently from 3a1919c to 510ce13 Compare August 17, 2026 19:01
Comment thread rhel10/precompiled/Dockerfile Outdated
LABEL org.opencontainers.image.title="NVIDIA Driver Container"
LABEL org.opencontainers.image.url="https://catalog.ngc.nvidia.com/orgs/nvidia/containers/driver"
LABEL org.opencontainers.image.vendor="NVIDIA"
LABEL org.opencontainers.image.version="${DRIVER_VERSION}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image version has kernel version (in case of precompiled) and OS appended to it. Example: nvcr.io/nvidia/driver:595-6.8.0-1060-aws-ubuntu24.04 (precompiled), nvcr.io/nvidia/driver:580.173.02-rhel10 (non-precompiled).

@karthikvetrivel karthikvetrivel Aug 17, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated org.opencontainers.image.version to match the published tag format in all Dockerfiles:

  • non-precompiled: ${DRIVER_VERSION}-<dist>
  • precompiled ubuntu: ${DRIVER_BRANCH}-${KERNEL_VERSION}-<dist>
  • precompiled rhel9/10: ${DRIVER_VERSION}-${KERNEL_VERSION}-${OS_TAG} (rhel8 has no OS_TAG arg, so ${DRIVER_VERSION}-${KERNEL_VERSION}-rhel8)
  • vgpu-manager: ${DRIVER_VERSION}-<dist>

Note: rocky builds reuse the rhel Dockerfiles, so those side-builds will carry the rhel dist suffix (same caveat as image.base.name).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: rocky builds reuse the rhel Dockerfiles, so those side-builds will carry the rhel dist suffix (same caveat as image.base.name)

Is there an env variable accessible inside the Dockerfile that gives rocky info during builds? The actual images do have -rocky* suffix, so rhel suffix is not fully accurate. Not a blocker though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this information is in the Makefile but doesn't get passed to the build. However, I made another change to pass DIST as a build arg and declare ARG DIST=<distro-default> in each Dockerfile.

Now, rocky builds should have the rocky suffix.

@karthikvetrivel
karthikvetrivel force-pushed the add-oci-image-labels branch 2 times, most recently from 0522cfc to 181ac40 Compare August 17, 2026 20:08
Comment thread rhel8/precompiled/Dockerfile Outdated
LABEL org.opencontainers.image.title="NVIDIA Driver Container"
LABEL org.opencontainers.image.url="https://catalog.ngc.nvidia.com/orgs/nvidia/containers/driver"
LABEL org.opencontainers.image.vendor="NVIDIA"
LABEL org.opencontainers.image.version="${DRIVER_VERSION}-${KERNEL_VERSION}-rhel8"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should rhel8 be replaced by OS_TAG here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@karthikvetrivel karthikvetrivel self-assigned this Aug 18, 2026
Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants