https://github.com/devemio/docker-color-output
🎨 Docker color output which improves readability.
https://github.com/devemio/docker-color-output
docker go
Last synced: 5 months ago
JSON representation
🎨 Docker color output which improves readability.
- Host: GitHub
- URL: https://github.com/devemio/docker-color-output
- Owner: devemio
- License: mit
- Created: 2019-03-13T19:20:29.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-03-02T10:24:20.000Z (over 1 year ago)
- Last Synced: 2025-05-25T06:07:42.375Z (about 1 year ago)
- Topics: docker, go
- Language: Go
- Homepage:
- Size: 106 KB
- Stars: 135
- Watchers: 3
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Docker Color Output is a lightweight CLI that adds readable, customizable colors to Docker command output. It reads from stdin, applies a YAML ruleset with per-column logic, and writes clean, aligned tables to stdout.
## Features
- Cross-platform: macOS, Linux, Windows.
- YAML rules: per-column colors, matches, and thresholds.
- Pipeline-friendly: works as a simple pipe in shell workflows.
## Installation
Binaries are available on the [releases](https://github.com/devemio/docker-color-output/releases) page.
#### Mac
```bash
brew install dldash/core/docker-color-output
```
#### Linux
```bash
sudo add-apt-repository ppa:dldash/core
sudo apt update
sudo apt install docker-color-output
```
#### Windows
Download the Windows build from the [releases](https://github.com/devemio/docker-color-output/releases) page.
## Quick Start
```bash
docker ps | docker-color-output
```
```bash
docker images [--format] 2>/dev/null | docker-color-output
```
> [!NOTE]
> On Docker 29+, `docker images` writes extra output to stderr, so redirect it (`2>/dev/null`) when piping into `docker-color-output`.
## Configuration
Pass a custom YAML config with `-c`:
```bash
docker-color-output -c ~/.config/docker-color-output/config.yaml
```
See `internal/config/default.yaml` for the full default configuration, including all commands and rules.
Example override:
```yaml
layout:
headerColor: yellow
rules:
commands:
dockerPs:
rules:
"STATUS":
pipeline:
- type: match
when:
- contains: "Exited"
color: red
default:
color: brown
```
## Usage
If you want shortcuts, use the bash aliases in `bash/aliases.sh`.
Tested with Docker `29.1.3`.
### docker images / docker image ls
```bash
di # alias
```
```bash
docker images [--format] 2>/dev/null | docker-color-output
```

### docker ps
```bash
dps # alias
```
```bash
docker ps [-a] [--format] | docker-color-output
```

### docker compose ps
```bash
dcps # alias
```
```bash
docker compose ps | docker-color-output
```

### docker stats
```bash
ds # alias
```
```bash
docker stats [--no-stream] | docker-color-output
```

## License
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).