Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman images -q <image@digest> not working like docker #18445

Closed
KCSesh opened this issue May 3, 2023 · 8 comments
Closed

podman images -q <image@digest> not working like docker #18445

KCSesh opened this issue May 3, 2023 · 8 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@KCSesh
Copy link

KCSesh commented May 3, 2023

Issue Description

podman images -q image@digest not working like docker does.

Steps to reproduce the issue

Steps to reproduce the issue

  1. podman images --digests
  2. podman images -q docker.io/library/ubuntu@sha256:0b8a884ad7ed20e50a68108895a6e7db54b303ad73b22b6b9ff5f60740dc03e2
  3. <No output>

Describe the results you received

No output of image id

root@ip-172-31-32-127:/home/ubuntu# podman images --digests
REPOSITORY                TAG         DIGEST                                                                   IMAGE ID      CREATED     SIZE
docker.io/library/ubuntu  latest      sha256:0b8a884ad7ed20e50a68108895a6e7db54b303ad73b22b6b9ff5f60740dc03e2  3b418d7b466a  8 days ago  80.3 MB
root@ip-172-31-32-127:/home/ubuntu# podman images -q docker.io/library/ubuntu@sha256:0b8a884ad7ed20e50a68108895a6e7db54b303ad73b22b6b9ff5f60740dc03e2
root@ip-172-31-32-127:/home/ubuntu#

Describe the results you expected

Output of the image id

root@ip-172-31-32-127:/home/ubuntu# docker images --digests
REPOSITORY   TAG       DIGEST                                                                    IMAGE ID       CREATED      SIZE
ubuntu       latest    sha256:dfd64a3b4296d8c9b62aa3309984f8620b98d87e47492599ee20739e8eb54fbf   3b418d7b466a   8 days ago   77.8MB

root@ip-172-31-32-127:/home/ubuntu# docker images -q ubuntu@sha256:dfd64a3b4296d8c9b62aa3309984f8620b98d87e47492599ee20739e8eb54fbf
3b418d7b466a

podman info output

root@ip-172-31-32-127:/home/ubuntu# podman info
host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
  - devices
  - freezer
  - net_cls
  - perf_event
  - net_prio
  - hugetlb
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.1.2, commit: '
  cpus: 16
  distribution:
    codename: focal
    distribution: ubuntu
    version: "20.04"
  eventLogger: journald
  hostname: ip-172-31-32-127
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.15.0-1035-aws
  linkmode: dynamic
  logDriver: journald
  memFree: 5587431424
  memTotal: 32823238656
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: ea1fe3938eefa14eb707f1d22adff4db670645d6
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: true
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.8
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.3
  swapFree: 0
  swapTotal: 0
  uptime: 50h 31m 50.96s (Approximately 2.08 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 1
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.4.2
  Built: 0
  BuiltTime: Thu Jan  1 00:00:00 1970
  GitCommit: ""
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 3.4.2

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

No

Additional environment details

AWS EC2 instnace

Additional information

No response

@KCSesh KCSesh added the kind/bug Categorizes issue or PR as related to a bug. label May 3, 2023
@KCSesh
Copy link
Author

KCSesh commented May 3, 2023

This also seems to be an issue with the filter as well:

root@ip-172-31-32-127:/home/ubuntu# docker images --filter=reference='ubuntu@sha256:dfd64a3b4296d8c9b62aa3309984f8620b98d87e47492599ee20739e8eb54fbf'
REPOSITORY   TAG       IMAGE ID       CREATED      SIZE
ubuntu       <none>    3b418d7b466a   8 days ago   77.8MB
root@ip-172-31-32-127:/home/ubuntu/# docker images -q --filter=reference='ubuntu@sha256:dfd64a3b4296d8c9b62aa3309984f8620b98d87e47492599ee20739e8eb54fbf'
3b418d7b466a

But podman:

root@ip-172-31-32-127:/home/ubuntu# podman images --digests
REPOSITORY                TAG         DIGEST                                                                   IMAGE ID      CREATED     SIZE
docker.io/library/ubuntu  latest      sha256:0b8a884ad7ed20e50a68108895a6e7db54b303ad73b22b6b9ff5f60740dc03e2  3b418d7b466a  8 days ago  80.3 MB

root@ip-172-31-32-127:/home/ubuntu# podman images --filter=reference='docker.io/library/ubuntu@sha256:0b8a884ad7ed20e50a68108895a6e7db54b303ad73b22b6b9ff5f60740dc03e2'
REPOSITORY  TAG         IMAGE ID    CREATED     SIZE

root@ip-172-31-32-127:/home/ubuntu# podman images -q --filter=reference='docker.io/library/ubuntu@sha256:0b8a884ad7ed20e50a68108895a6e7db54b303ad73b22b6b9ff5f60740dc03e2'
root@ip-172-31-32-127:/home/ubuntu#

And just for clarity, tags do work:

root@ip-172-31-32-127:/home/ubuntu# podman images -q --filter=reference='docker.io/library/ubuntu:latest'
3b418d7b466a

root@ip-172-31-32-127:/home/ubuntu#  podman images -q docker.io/library/ubuntu:latest
3b418d7b466a

@github-actions
Copy link

github-actions bot commented Jun 4, 2023

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2023

@vrothberg This looks like a bug in containers/common/libimage?

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2023

Looks like libimage is ignoring digest when accessed by reference?

@vrothberg
Copy link
Member

Thanks for reaching out, @KCSesh! I will take a look.

@vrothberg
Copy link
Member

I opened containers/common#1503 to fix the issue.

vrothberg added a commit to vrothberg/common that referenced this issue Jun 14, 2023
Make sure that reference filters properly work on digests as well.
To keep things simple, try to lookup an image for the user-specified
value and compare IDs.  This will implicitly fix #containers/podman/issues/18445
and probably more (unknown) issues.

Fixes: #containers/podman/issues/18445
Signed-off-by: Valentin Rothberg <[email protected]>
vrothberg added a commit to vrothberg/common that referenced this issue Jun 14, 2023
Make sure that reference filters properly work on digests as well.
To keep things simple, try to lookup an image for the user-specified
value and compare IDs.  This will implicitly fix #containers/podman/issues/18445
and probably more (unknown) issues.

Fixes: #containers/podman/issues/18445
Signed-off-by: Valentin Rothberg <[email protected]>
@github-actions
Copy link

github-actions bot commented Aug 4, 2023

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Aug 5, 2023

This is supposed to be fixed in podman 4.6 or at least in the main branch, I believe.

@rhatdan rhatdan closed this as completed Aug 5, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

3 participants