containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
22.97k stars 2.34k forks source link

`podman search` fails for `docker.io/library` images #20230

Closed lnicola closed 10 months ago

lnicola commented 11 months ago

Issue Description

podman search docker.io/debian returns docker.io/library/debian, but podman search docker.io/library/debian doesn't.

docker search docker.io/library/debian works.

Steps to reproduce the issue

  1. podman search docker.io/debian
  2. podman search docker.io/library/debian

Describe the results you received

No results for docker.io/library/debian.

Describe the results you expected

Some results, just like with docker search docker.io/library/debian.

podman info output

podman 4.7.0 on Fedora 38 and quay.io/containers/podman:v4.6.1 (v4.7.0 is missing)

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

No response

Additional information

Found by @strk.

rhatdan commented 11 months ago

@vrothberg, should we just strip library out of the search?

rhatdan commented 11 months ago

The following two commands work, so this is an issue with Podman probably not containers/image. skopeo inspect docker://docker.io/library/debian skopeo inspect docker://docker.io/debian

boaz0 commented 11 months ago

@rhatdan can you assign this to me. I believe I have some time to kill on this.

rhatdan commented 11 months ago

You got it, I have a feeling this is something to do with containers/common/libimage.

vrothberg commented 11 months ago

Thanks, @boaz0 !

boaz0 commented 11 months ago

It seems like docker are removing the "library" from the search term if RegistryIndexInfo is official:

    if index.Official {
        // If pull "library/foo", it's stored locally under "foo"
        remoteName = strings.TrimPrefix(remoteName, "library/")
    }

https://github.com/moby/moby/blob/master/registry/search.go#L99-L102

Maybe I can apply something similar in common/libimage

Luap99 commented 10 months ago

Looks like the fix (https://github.com/containers/image/pull/2133) was merged, and will be included in podman the next we update c/image