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

When using podman as a backend for docker cli docker ps fails to show port-forwarding correctly #22367

Closed
VinGarcia opened this issue Apr 12, 2024 · 1 comment
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. remote Problem is in podman-remote

Comments

@VinGarcia
Copy link

Issue Description

I have podman and podman desktop installed on my ARM MacOS.

I am still using the docker CLI tool although the backend is podman-desktop, and I got confused today when docker ps reported an incorrect value for a specific container's ports. When I use podman ps though it shows the ports correctly, and if I try to connect the the host port it works fine, so it is just a visualization problem.

Steps to reproduce the issue

I prepared a small reproducible example:

$ docker run --name podman-bug-report --rm -p 9080:80 -d ubuntu bash -c 'sleep 20'
$ docker ps | grep podman-bug-report
b5ec6d9ee0b5   ubuntu:latest                                            "bash -c sleep 20"       5 seconds ago    Up 5 seconds    80/tcp                     podman-bug-report
$ podman ps | grep podman-bug-report
b5ec6d9ee0b5  docker.io/library/ubuntu:latest                         bash -c sleep 20      7 seconds ago   Up 7 seconds             0.0.0.0:9080->80/tcp                        podman-bug-report

If you look at the "ports" section of both outputs you will see that the podman CLI is correctly displaying 0.0.0.0:9080->80/tcp, but docker is only displaying 80/tcp, which I think is not the intended behavior.

I did notice one interesting thing though, if I include a source IP on the port pattern, e.g. ::1:9080:80 instead of just 9080:80 the docker CLI does show the correct value, e.g.:

$ docker run --name podman-bug-report --rm -p ::1:9080:80 -d ubuntu bash -c 'sleep 20'
7f031353825a6babe4de4f1aa312e2ff781e22f1e0094b77efd10a37103b47b8
$ docker ps | grep podman-bug-report 
7f031353825a   ubuntu:latest                                            "bash -c sleep 20"       10 seconds ago   Up 9 seconds    ::1:9080->80/tcp           podman-bug-report
$ podman ps | grep podman-bug-report 
7f031353825a  docker.io/library/ubuntu:latest                         bash -c sleep 20      14 seconds ago  Up 14 seconds            ::1:9080->80/tcp                            podman-bug-report

Describe the results you received

docker cli shows an incorrect value for the port field

Describe the results you expected

I expected the output of docker ps to match the output of podman ps when displaying which host ports are forwarded to each container.

podman info output

host:
  arch: arm64
  buildahVersion: 1.33.5
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - rdma
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.10-1.fc39.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 99.4
    systemPercent: 0.27
    userPercent: 0.33
  cpus: 5
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "39"
  eventLogger: journald
  freeLocks: 1990
  hostname: localhost.localdomain
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.7.5-200.fc39.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 184709120
  memTotal: 2044342272
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.fc39.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.10.0
    package: netavark-1.10.3-1.fc39.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.10.3
  ociRuntime:
    name: crun
    package: crun-1.14.3-1.fc39.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.14.3
      commit: 1961d211ba98f532ea52d2e80f4c20359f241a98
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240220.g1e6f92b-1.fc39.aarch64
    version: |
      pasta 0^20240220.g1e6f92b-1.fc39.aarch64-pasta
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/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,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 790h 19m 40.00s (Approximately 32.92 days)
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 38
    paused: 0
    running: 12
    stopped: 26
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 106769133568
  graphRootUsed: 20517179392
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 78
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.9.3
  Built: 1708357248
  BuiltTime: Mon Feb 19 12:40:48 2024
  GitCommit: ""
  GoVersion: go1.21.7
  Os: linux
  OsArch: linux/arm64
  Version: 4.9.3

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

No

Additional environment details

Its an MacBook Pro M1 running Sonoma 14.3.1 (23D60)

Additional information

No response

@VinGarcia VinGarcia added the kind/bug Categorizes issue or PR as related to a bug. label Apr 12, 2024
@github-actions github-actions bot added the remote Problem is in podman-remote label Apr 12, 2024
@Luap99
Copy link
Member

Luap99 commented Apr 15, 2024

Please test this with podman 5.0 again, I assume this works there.

@Luap99 Luap99 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jul 15, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jul 15, 2024
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. remote Problem is in podman-remote
Projects
None yet
Development

No branches or pull requests

2 participants