podman: Docker cli compatability in format: can't evaluate field RunningFor in type shared.PsContainerOutput

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Podman announced as a drop-in replacement for docker cli, but it fails to use RunningFor for format output of containers statistic.

Steps to reproduce the issue:

  1. Run any container by podman: podman run -d nginx:alpine
  2. Request formatted list of containers with .RunningFor placeholder like:
podman ps --format "table {{.Names}}\t{{.Status}}\t{{.RunningFor}}\t{{.Image}}\t{{.Ports}}"

Describe the results you received: Error:

$ podman ps --format "table {{.Names}}\t{{.Status}}\t{{.RunningFor}}\t{{.Image}}\t{{.Ports}}"
Names\tStatus\t\tImage\tPorts
Error: template: data:1:27: executing "data" at <.RunningFor>: can't evaluate field RunningFor in type shared.PsContainerOutput

Describe the results you expected: Output same as got from docker cli:

$ sudo docker ps --format "table {{.Names}}\t{{.Status}}\t{{.RunningFor}}\t{{.Image}}\t{{.Ports}}"
NAMES                 STATUS                            CREATED             IMAGE               PORTS
condescending_gould   Up About a minute                 2 minutes ago       nginx:alpine        80/tcp

Additional information you deem important (e.g. issue happens only occasionally): Always reproducible

Output of podman version:

Version:            1.8.1
RemoteAPI Version:  1
Go Version:         go1.14rc1
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.14rc1
  podman version: 1.8.1
host:
  BuildahVersion: 1.14.2
  CgroupVersion: v1
  Conmon:
    package: conmon-2.0.11-2.fc32.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.11, commit: 423069e5ba9d02727b79dcceacf8604bccefa439'
  Distribution:
    distribution: fedora
    version: "32"
  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
  MemFree: 6739705856
  MemTotal: 33385746432
  OCIRuntime:
    name: runc
    package: containerd.io-1.2.13-3.1.fc31.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc10
      commit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
      spec: 1.0.1-dev
  SwapFree: 6264819712
  SwapTotal: 6308229120
  arch: amd64
  cpus: 8
  eventlogger: journald
  hostname: 2.hubbitus.taskdata
  kernel: 5.6.0-0.rc5.git0.2.fc32.x86_64
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: slirp4netns-0.4.3-6.0.dev.gita8414d1.fc32.x86_64
    Version: |-
      slirp4netns version 0.4.3+dev
      commit: a8414d1d1629f6f7a93b60b55e183a93d10d9a1c
  uptime: 37h 25m 32.19s (Approximately 1.54 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  ConfigFile: /home/pasha/.config/containers/storage.conf
  ContainerStore:
    number: 4
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-0.7.6-2.0.dev.gitce61c7e.fc32.x86_64
      Version: |-
        fusermount3 version: 3.9.0
        fuse-overlayfs: version 0.7.6
        FUSE library version 3.9.0
        using FUSE kernel interface version 7.31
  GraphRoot: /home/pasha/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 4
  RunRoot: /run/user/1000/containers
  VolumePath: /home/pasha/.local/share/containers/storage/volumes

Package info (e.g. output of rpm -q podman or apt list podman):

$ rpm -q podman
podman-1.8.1-2.fc32.x86_64

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (15 by maintainers)

Most upvoted comments

@ashley-cui When the Docker CLI and Documentation are different, we generally go with the thing the CLI actually does