Skip to content

FIX docker ps (List containers) uses screen width, should use window width #30050

@allanlaal

Description

@allanlaal

Description:

when using docker ps on a terminal window that is less than screen width, the output does not look pretty

How to reproduce:

  1. open up a terminal (tested on mate-terminal on Ubuntu Mate 16.04 LTS)
  2. make the terminal windows width less than the screen (half even)
  3. run command: docker ps

Expected result

output is formatted so each container is on 1 row:

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                       NAMES
091ed00a9226        webdevops/php-apache:centos-7   "/opt/docker/bin/entr"   12 days ago         Up 20 seconds       80/tcp, 443/tcp, 9000/tcp   ps.c.xxxxxxxxx.www.2016-12-29
bee109752240        mysql:5.6.34                    "docker-entrypoint.sh"   12 days ago         Up 34 seconds       3306/tcp                    ps.c.xxxxxxxxx.db.2016-12-29
d2d217622de8        webdevops/php-apache:centos-7   "/opt/docker/bin/entr"   8 weeks ago         Up 6 seconds        80/tcp, 443/tcp, 9000/tcp   infra.ais.core.www.2016-11-08
bb422c0b9bf3        mysql:5.5.53        

Actual result:

output is formatted as if the terminal windows width is the same as the screens:

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                       NAMES
0912200a22f6        webdevops/php-apache:centos-7   "/opt/docker/bin/entr"   12 days ago         Up 20 seconds       80/tcp, 443/tcp, 9000/tcp   ps.c.xxxxxxxxx.
www.2016-12-29
bee109752240        mysql:5.6.34                    "docker-entrypoint.sh"   12 days ago         Up 34 seconds       3306/tcp                    ps.c.xxxxxxxxx.
db.2016-12-29
d2d217622de8        webdevops/php-apache:centos-7   "/opt/docker/bin/entr"   8 weeks ago         Up 6 seconds        80/tcp, 443/tcp, 9000/tcp   infra.ais.core.
www.2016-11-08     
bb422c0b9bf3        mysql:5.5.53                    "docker-entrypoint.sh"   8 weeks ago         Up 6 seconds        3306/tcp                    infra.ais.core.
db.2016-11-13

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliClientkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions