Loading...

Make docker ps readable

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

Does it bother you, that docker ps has too wide output?

$ sudo docker ps
CONTAINER ID        IMAGE                  COMMAND             CREATED             STATUS              PORTS                                            NAMES
44a2292b59a6        sonarqube:lts-alpine   "./bin/run.sh"      17 minutes ago      Up 17 minutes       0.0.0.0:9000->9000/tcp, 0.0.0.0:9092->9092/tcp   sonarqube

Well the command itself looks ugly (defining a custom format in GO language)


sudo docker ps --format 'CONTAINER ID: {{.ID}}\nIMAGE: {{.Image}}\nCOMMAND: {{.Command}}\nCREATED: {{.CreatedAt}}\nSTATUS: {{.Status}}\nPORTS: {{.Ports}}\nNAMES: {{.Names}}'

but the output is at least more readable :-)

CONTAINER ID: 44a2292b59a6
IMAGE: sonarqube:lts-alpine
COMMAND: "./bin/run.sh"
CREATED: 2016-09-26 22:30:14 +0200 CEST
STATUS: Up 23 minutes
PORTS: 0.0.0.0:9000->9000/tcp, 0.0.0.0:9092->9092/tcp
NAMES: sonarqube
Please remember the terms for blog comments.