podman icon indicating copy to clipboard operation
podman copied to clipboard

Distribution API seems missing

Open lnnwvr opened this issue 2 years ago • 15 comments

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 avatar Mar 09 '23 15:03 lnnwvr

What does docker return with this query?

rhatdan avatar Mar 09 '23 16:03 rhatdan

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

Luap99 avatar Mar 09 '23 17:03 Luap99

@Luap99 Could you implement this?

rhatdan avatar Mar 09 '23 17:03 rhatdan

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 ...

Luap99 avatar Mar 10 '23 13:03 Luap99

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

rxda avatar Mar 17 '23 05:03 rxda

Thanks @rxda, I assigned it to you

Luap99 avatar Mar 17 '23 13:03 Luap99

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

github-actions[bot] avatar Apr 29 '23 00:04 github-actions[bot]

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

rhatdan avatar Jul 29 '23 11:07 rhatdan

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

jackgris avatar Nov 18 '23 22:11 jackgris

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

rhatdan avatar Nov 19 '23 15:11 rhatdan

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

rxda avatar Nov 21 '23 02:11 rxda

Can I work on this issue?

pratt-snap avatar Jul 26 '24 11:07 pratt-snap

Can I work on this issue?

yes

zhangguanzhang avatar Jul 26 '24 11:07 zhangguanzhang

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

rhatdan avatar Jul 26 '24 12:07 rhatdan

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.

jackgris avatar Jul 26 '24 14:07 jackgris

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.

kanlac avatar Feb 10 '25 23:02 kanlac

@kanlac Thanks, I assigned it to you

Luap99 avatar Feb 11 '25 10:02 Luap99