[PR #15538] Dockerfile: add OCI standard image labels #41067

Open
opened 2026-04-23 01:48:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15538
Author: @Erwan-loot
Created: 4/13/2026
Status: 🔄 Open

Base: mainHead: add-oci-image-labels


📝 Commits (3)

  • b442134 Dockerfile: add OCI standard image labels
  • 3da8c05 .github/workflows/release.yaml: pass VERSION, REVISION, CREATED build args for OCI labels
  • f855470 Update .github/workflows/release.yaml

📊 Changes

2 files changed (+18 additions, -1 deletions)

View changed files

📝 .github/workflows/release.yaml (+5 -1)
📝 Dockerfile (+13 -0)

📄 Description

Context

Add OCI Image Spec standard labels to `Dockerfile` for better image metadata and container registry compatibility.

Type

Improvement — metadata only, no functional changes.

Labels Added

Label Value Source
`org.opencontainers.image.title` `Ollama` Static
`org.opencontainers.image.description` `Get up and running with large language models` Static
`org.opencontainers.image.url` `https://ollama.com` Static
`org.opencontainers.image.source` `https://github.com/ollama/ollama` Static
`org.opencontainers.image.documentation` `https://github.com/ollama/ollama/tree/main/docs` Static
`org.opencontainers.image.vendor` `Ollama` Static
`org.opencontainers.image.licenses` `MIT` Static
`org.opencontainers.image.version` Release tag (e.g. `0.7.1`) Build arg — `setup-environment` output
`org.opencontainers.image.revision` Git commit SHA Build arg — `github.sha`
`org.opencontainers.image.created` Tag push timestamp Build arg — `github.event.created_at`

Labels are placed in the final `ubuntu:24.04` stage, after all `RUN`/`COPY`/`ENV` instructions and before `ENTRYPOINT`, so they don't cause unnecessary cache invalidation.

Benefits

  • Registry compatibility: GHCR, Docker Hub, and other registries display these labels (description, license, source link) in their UI
  • Dependency bot changelogs: Renovate and Dependabot use `org.opencontainers.image.source` to link release notes in update PRs — currently missing, so changelog links don't resolve
  • Image provenance: `revision` and `created` allow pinning images to exact source commits for security audits
  • Standardization: follows the OCI Image Spec, the successor to the now-deprecated Label Schema

Changes

  • `Dockerfile`: adds `ARG VERSION/REVISION/CREATED` and a `LABEL` block in the final stage
  • `.github/workflows/release.yaml`: passes `VERSION`, `REVISION` (`github.sha`), and `CREATED` (`github.run_started_at`) as additional build args to the `docker-build-push` job — no matrix entries modified

How to verify

After a release build:
```bash
docker inspect ollama/ollama:latest --format '{{ json .Config.Labels }}' | jq
```

References


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15538 **Author:** [@Erwan-loot](https://github.com/Erwan-loot) **Created:** 4/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `add-oci-image-labels` --- ### 📝 Commits (3) - [`b442134`](https://github.com/ollama/ollama/commit/b4421341a7dff637efadf0b2d3f0054dab24ecd3) Dockerfile: add OCI standard image labels - [`3da8c05`](https://github.com/ollama/ollama/commit/3da8c0511e557492b65fc73d6f0f587b18ce05b9) .github/workflows/release.yaml: pass VERSION, REVISION, CREATED build args for OCI labels - [`f855470`](https://github.com/ollama/ollama/commit/f85547016fe8c268d502afe4fb8e1809468b8d91) Update .github/workflows/release.yaml ### 📊 Changes **2 files changed** (+18 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/release.yaml` (+5 -1) 📝 `Dockerfile` (+13 -0) </details> ### 📄 Description ## Context Add [OCI Image Spec](https://github.com/opencontainers/image-spec/blob/main/annotations.md) standard labels to \`Dockerfile\` for better image metadata and container registry compatibility. ## Type Improvement — metadata only, no functional changes. ## Labels Added | Label | Value | Source | |-------|-------|--------| | \`org.opencontainers.image.title\` | \`Ollama\` | Static | | \`org.opencontainers.image.description\` | \`Get up and running with large language models\` | Static | | \`org.opencontainers.image.url\` | \`https://ollama.com\` | Static | | \`org.opencontainers.image.source\` | \`https://github.com/ollama/ollama\` | Static | | \`org.opencontainers.image.documentation\` | \`https://github.com/ollama/ollama/tree/main/docs\` | Static | | \`org.opencontainers.image.vendor\` | \`Ollama\` | Static | | \`org.opencontainers.image.licenses\` | \`MIT\` | Static | | \`org.opencontainers.image.version\` | Release tag (e.g. \`0.7.1\`) | Build arg — \`setup-environment\` output | | \`org.opencontainers.image.revision\` | Git commit SHA | Build arg — \`github.sha\` | | \`org.opencontainers.image.created\` | Tag push timestamp | Build arg — \`github.event.created_at\` | Labels are placed in the final \`ubuntu:24.04\` stage, after all \`RUN\`/\`COPY\`/\`ENV\` instructions and before \`ENTRYPOINT\`, so they don't cause unnecessary cache invalidation. ## Benefits - **Registry compatibility**: GHCR, Docker Hub, and other registries display these labels (description, license, source link) in their UI - **Dependency bot changelogs**: Renovate and Dependabot use \`org.opencontainers.image.source\` to link release notes in update PRs — currently missing, so changelog links don't resolve - **Image provenance**: \`revision\` and \`created\` allow pinning images to exact source commits for security audits - **Standardization**: follows the OCI Image Spec, the successor to the now-deprecated Label Schema ## Changes - \`Dockerfile\`: adds \`ARG VERSION/REVISION/CREATED\` and a \`LABEL\` block in the final stage - \`.github/workflows/release.yaml\`: passes \`VERSION\`, \`REVISION\` (\`github.sha\`), and \`CREATED\` (\`github.run_started_at\`) as additional build args to the \`docker-build-push\` job — no matrix entries modified ## How to verify After a release build: \`\`\`bash docker inspect ollama/ollama:latest --format '{{ json .Config.Labels }}' | jq \`\`\` ## References - [OCI Image Spec — Annotations](https://github.com/opencontainers/image-spec/blob/main/annotations.md) - [Renovate Docker datasource](https://docs.renovatebot.com/modules/datasource/docker/) - [Docker — Manage tags and labels](https://docs.docker.com/build/ci/github-actions/manage-tags-labels/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 01:48:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#41067