DEV Community

Peter Klein
Peter Klein

Posted on

Beautify docker container output

Sometimes as a developer you have to manage some containers.
To check container infos you type docker container ls and you get this ugly output:
Alt Text

It is not very legible but there is a solution to this, and it is easier than you think.

First create a variable and store it via
export DOCKER_FORMAT="ID\t{{.ID}}\nName\t{{.Names}}\nImage\t{{.Image}}\nPorts\t{{.Ports}}\nCommand\t{{.Command}}\nCreated\t{{.CreatedAt}}\nStatus\t{{.Status}}\n"

Then you can use it via docker ps --format=$DOCKER_FORMAT and you get this beautiful output

Alt Text

Another way to solve this is to write a config file. I will write another post for this issue.

Top comments (0)