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

Distribution API seems missing #17726

Open
lnnwvr opened this issue Mar 9, 2023 · 17 comments
Open

Distribution API seems missing #17726

lnnwvr opened this issue Mar 9, 2023 · 17 comments
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/bug Categorizes issue or PR as related to a bug.

Comments

@lnnwvr
Copy link

lnnwvr commented Mar 9, 2023

Issue Description

DockerApi 1.41 describes a distribution api path to query image data. This seems to be missing int he current podman socket api implementation

Steps to reproduce the issue

podman system service --time=0 unix:///tmp/podman.sock

curl -v --unix-socket /tmp/podman.sock -X POST http://localhost/v1.41/distribution/docker.io/library/postgres:latest/json

Describe the results you received

*   Trying /tmp/podman.sock:0...
* Connected to localhost (/tmp/podman.sock) port 80 (#0)
> POST /v1.41/distribution/docker.io/library/postgres:latest/json HTTP/1.1
> Host: localhost
> User-Agent: curl/7.87.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 09 Mar 2023 15:27:57 GMT
< Content-Length: 10
< 
Not Found
* Connection #0 to host localhost left intact

Describe the results you expected

The json containing the data

podman info output

$ podman info
host:
  arch: amd64
  buildahVersion: 1.30.0-dev
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: /usr/bin/conmon is owned by conmon 1:2.1.6-1
    path: /usr/bin/conmon
    version: 'conmon version 2.1.6, commit: 158b5421dbac6bda96b1457955cf2e3c34af29bc'
  cpuUtilization:
    idlePercent: 97.3
    systemPercent: 0.72
    userPercent: 1.98
  cpus: 16
  databaseBackend: boltdb
  distribution:
    distribution: manjaro
    version: unknown
  eventLogger: journald
  hostname: unimportant
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.15.94-1-MANJARO
  linkmode: dynamic
  logDriver: journald
  memFree: 1965797376
  memTotal: 46107783168
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: /usr/bin/crun is owned by crun 1.8-1
    path: /usr/bin/crun
    version: |-
      crun version 1.8
      commit: 0356bf4aff9a133d655dc13b1d9ac9424706cac4
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /etc/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: /usr/bin/slirp4netns is owned by slirp4netns 1.2.0-1
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.4
  swapFree: 49937981440
  swapTotal: 50793357312
  uptime: 78h 33m 52.00s (Approximately 3.25 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/mleinweber/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/mleinweber/.local/share/containers/storage
  graphRootAllocated: 452606554112
  graphRootUsed: 203020681216
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 27
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/mleinweber/.local/share/containers/storage/volumes
version:
  APIVersion: 4.5.0-dev
  Built: 1678375483
  BuiltTime: Thu Mar  9 16:24:43 2023
  GitCommit: 747369c82df67d83f65d064855d83a40f0ee99cc-dirty
  GoVersion: go1.20
  Os: linux
  OsArch: linux/amd64
  Version: 4.5.0-dev

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@lnnwvr lnnwvr added the kind/bug Categorizes issue or PR as related to a bug. label Mar 9, 2023
@rhatdan
Copy link
Member

rhatdan commented Mar 9, 2023

What does docker return with this query?

@Luap99
Copy link
Member

Luap99 commented Mar 9, 2023

Docker API is described here: https://docs.docker.com/engine/api/v1.42/#tag/Distribution

@rhatdan
Copy link
Member

rhatdan commented Mar 9, 2023

@Luap99 Could you implement this?

@Luap99
Copy link
Member

Luap99 commented Mar 10, 2023

I don't have much time, I need to work on the network stuff.
Adding the rest endpoint is straightforward but I am not sure what c/image APIs we have to get the data. It looks somewhat similar to skopeo inspect --raw ...

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Mar 13, 2023
@rxda
Copy link

rxda commented Mar 17, 2023

Kindly to ask if there is somebody working for this issue? If not, I'm glad to undertake it.
@rhatdan

@Luap99
Copy link
Member

Luap99 commented Mar 17, 2023

Thanks @rxda, I assigned it to you

com4 added a commit to com4/aws-sam-cli that referenced this issue Apr 14, 2023
Podman doesn't support the distribution API. This is used when
querying to see if a docker image is up-to-date.

Instead of crashing this treats the stale image as good enough.

See Also: containers/podman#17726
Fixes: aws#5019
@github-actions
Copy link

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

github-merge-queue bot pushed a commit to aws/aws-sam-cli that referenced this issue May 1, 2023
…5020)

* fix: Favor a stale image when daemon doesn't support registry query

Podman doesn't support the distribution API. This is used when
querying to see if a docker image is up-to-date.

Instead of crashing this treats the stale image as good enough.

See Also: containers/podman#17726
Fixes: #5019

* Favor updating image when docker daemon is unable to check version

* Update error message when docker cannot check image version
mndeveci pushed a commit to mndeveci/aws-sam-cli that referenced this issue May 4, 2023
…ws#5020)

* fix: Favor a stale image when daemon doesn't support registry query

Podman doesn't support the distribution API. This is used when
querying to see if a docker image is up-to-date.

Instead of crashing this treats the stale image as good enough.

See Also: containers/podman#17726
Fixes: aws#5019

* Favor updating image when docker daemon is unable to check version

* Update error message when docker cannot check image version
@rhatdan
Copy link
Member

rhatdan commented Jul 29, 2023

@rxda did you ever get a chance to work on this?

@jackgris
Copy link
Contributor

Is anyone currently addressing this issue? If not, I would be glad to take it on.

@rhatdan
Copy link
Member

rhatdan commented Nov 19, 2023

Since we never heard back from @rxda, you got it.

@rhatdan rhatdan assigned jackgris and unassigned rxda Nov 19, 2023
@rxda
Copy link

rxda commented Nov 21, 2023

I'm so sorry, I have some trouble in my life this year, so I didn't have time to finish the work. I did some basic work, hope it helps
moby distribution router
some basic work

@pratt-snap
Copy link

Can I work on this issue?

@zhangguanzhang
Copy link
Collaborator

Can I work on this issue?

yes

@rhatdan
Copy link
Member

rhatdan commented Jul 26, 2024

Yes, I don't think @jackgris was able to work on it.

@jackgris
Copy link
Contributor

Yes, I'm sorry. Right after I requested this issue, I started having too much work at my job. I have time for it now, but if @pratt-snap wants to work on it, I'm fine with that.

@kanlac
Copy link

kanlac commented Feb 10, 2025

I've been working on this issue recently and have passed the basic functionality tests. If @pratt-snap is okay, I'd like to take it over, clean up my changes, and submit a PR.

@Luap99
Copy link
Member

Luap99 commented Feb 11, 2025

@kanlac Thanks, I assigned it to you

kanlac added a commit to kanlac/podman that referenced this issue Feb 20, 2025
kanlac added a commit to kanlac/podman that referenced this issue Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

8 participants