Skip to content

feat: add imageVersion to ImageInfo and related types for enhanced image tracking#4

Open
RF1705 wants to merge 1 commit into
finder39:masterfrom
RF1705:master
Open

feat: add imageVersion to ImageInfo and related types for enhanced image tracking#4
RF1705 wants to merge 1 commit into
finder39:masterfrom
RF1705:master

Conversation

@RF1705
Copy link
Copy Markdown

@RF1705 RF1705 commented May 22, 2026

Title: Expose OCI image version labels in stack service data

## Summary

This PR exposes the optional OCI image version label for stack services through the Dockge REST API.

If a Docker image provides the standard label:

```text
org.opencontainers.image.version

Dockge now reads that value during the existing local image inspection and includes it in the service data as:

"imageVersion": "2026.5.4"

Why

Many container images, including Home Assistant, publish the application version as an OCI image label rather than only through the image tag.

For example, an image may be configured as:

ghcr.io/home-assistant/home-assistant:stable

but the actual installed app version is available as:

"org.opencontainers.image.version": "2026.5.4"

Exposing this through the API allows integrations and dashboards to show the real application version while keeping the image tag as a fallback.

Changes

  • Read Config.Labels["org.opencontainers.image.version"] from docker inspect output.
  • Store the value on ImageInfo as imageVersion.
  • Include imageVersion in each stack service entry.
  • Extend the shared ServiceData type with:
imageVersion: string | null
  • Preserve the existing remote digest, local digest, and update detection behavior.

API behavior

Before:

{
  "name": "homeassistant",
  "image": "ghcr.io/home-assistant/home-assistant:stable",
  "imageUpdateAvailable": false,
  "remoteImageDigest": "..."
}

After:

{
  "name": "homeassistant",
  "image": "ghcr.io/home-assistant/home-assistant:stable",
  "imageUpdateAvailable": false,
  "remoteImageDigest": "...",
  "imageVersion": "2026.5.4"
}

If the label is not present, imageVersion is null.

Compatibility

This is backward-compatible. Existing API consumers can ignore the new field, and images without the OCI version label continue to behave exactly as before.

Testing

I could not run the TypeScript check in this environment because npm was not available in the shell path.

The change is limited to the existing image inspection path and the shared service data type.

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.

1 participant