Skip to content

Colorized the output of docker ps

License

Notifications You must be signed in to change notification settings

bouteillerAlan/dockolor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

🐳 dockolor – Colorized docker ps Output

dockolor is a lightweight plugin that enhances your docker ps experience with color-coded output based on container status. It also replaces common aliases like dps and dpsa if defined.

Features

  • Colors container statuses:
    • 🟢 Up / Running — Green
    • 🟡 Paused — Yellow
    • 🔴 Exited / Dead — Red
  • Colors are theme aware.
  • Preserves the original Docker ps output, just adds color.
  • Replaces dps and dpsa aliases (from the docker plugin) with colored versions.
  • Works well even with --format json.
  • Falls back gracefully if awk is not installed.

image

Installation

Oh My Zsh

Clone the repository into the OhMyZsh plugin directory:

git clone git@github.com:bouteillerAlan/dockolor.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/dockolor

Then add dockolor in your plugin list

plugins=(... dockolor)

Reload your shell:

source ~/.zshrc

Any other way

  • Copy or clone the dockolor.plugin.zsh file
  • Source it in your .zshrc or .bashrc

Reload your shell:

source ~/.zshrc

Usage and example

Flag can be put in any order since we just check for docker container ps or docker ps.

So you can just use your command like you're always do:

  • docker ps the output is automatically colorized
  • docker container ps same as docker ps
  • docker ps --format json --no-trunc -a yes that works too :)
  • docker <any other command> are passed through unchanged
  • dps replaced the one created by the docker plugin for oh-my-zsh, but it acts the same way (colorized docker ps)
  • dpsa same as dps (colorized docker ps -a)
  • You can also call dockolor directly, this is basically the docker command

About

Colorized the output of docker ps

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors

Languages