DEV Community

Peter Klein
Peter Klein

Posted on

1

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)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay