Formatting Docker cli for better readability

Published on
1 mins read

Sometimes docker ps -a is quite chaotic, let’s prettify them to make it easier to read

Use --format to show only items you want to see (i.e. I don’t really need to print all exposed ports at the moment)

> docker ps -a --format="table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Command}}\t{{.Status}}"

CONTAINER ID   NAMES             IMAGE                              COMMAND                  STATUS
161748f90bd0   pixiv-bookmarks   pixiv-bookmarks-visualizer-pixiv   "docker-entrypoint.s…"   Up 10 seconds
021df5c41d84   docker-caddy-1    caddy:alpine                       "caddy run --config …"   Restarting (1) Less than a second ago