Skip to content

Bug: registry host is dropped from image names, so ghcr.io / quay.io / mcr.microsoft.com images are looked up on Docker Hub #578

Closed

Description

@vibgrate-team

Context

Both parseDockerfile and parseDockerCompose in src/core-open/scanners/docker-scanner.ts build the row name as ${parsed.namespace || 'library'}/${parsed.image}, ignoring parsed.registry from parseDockerImage (src/core-open/scanners/docker-cache.ts). So:

  • ghcr.io/acme/api:1.4.0 is recorded as acme/api
  • mcr.microsoft.com/dotnet/sdk:8.0 is recorded as dotnet/sdk
  • quay.io/prometheus/node-exporter:v1.8.0 is recorded as prometheus/node-exporter

and each is then compared with whatever Docker Hub has under that name, which can be a different image entirely. Two images with the same path on different registries also collapse into one row.

What to do

  • Keep the registry in the recorded name for non-Docker-Hub images (Docker Hub stays library/<image> / <ns>/<image> as documented in DOCS.md).
  • Only query Docker Hub for Docker Hub images; leave others with drift unknown (or a registry lookup if one already exists) rather than a wrong Hub answer.
  • Add unit tests for Dockerfile and Compose inputs.

Acceptance

  • The three examples above keep their registry in the row name.
  • None of them triggers a Docker Hub tag lookup.
  • nginx:1.27 and bitnami/redis:7.4 behave exactly as today.

Activity

  1. added
    bug
    on Nov 4, 2026
  2. vibgrate-team commented on Nov 4, 2026

    @vibgrate-team
    ContributorAuthor

    Confirmed on main: both parsers build the row name as `${parsed.namespace || 'library'}/${parsed.image}` and drop parsed.registry, and scanDocker then sends every name to fetchDockerVersionsBulk, which is a Docker Hub lookup.

    Two pieces to watch: (1) keep the registry in the name only when it's set and isn't a Docker Hub alias (docker.io, index.docker.io, registry-1.docker.io), and (2) filter non-Hub names out before the bulk fetch so they keep drift unknown instead of a wrong answer. This depends a little on #587, since parseDockerImage currently mis-splits host:port registries, so a test with ghcr.io/... and mcr.microsoft.com/... is the safest place to start.

  3. 17302513901yh-lang commented on Nov 8, 2026

    @17302513901yh-lang
    Contributor

    I'd like to take this one. I'll add a shared dockerRowName() in docker-cache.ts that keeps the registry host unless it is a Docker Hub alias (docker.io, index.docker.io, registry-1.docker.io), and use it in both parsers plus the cache key, so the existing non-Hub guard in fetchDockerLatestVersion finally sees the registry. Tests cover your three examples, compose, the aliases, the same path on two registries, and a registry port.

  4. added a commit that references this issue on Nov 11, 2026
    8e7b9dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions