Skip to content

Commit

Permalink
2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
devemio authored Apr 3, 2021
1 parent c470da0 commit 32ee881
Show file tree
Hide file tree
Showing 25 changed files with 645 additions and 530 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.PHONY: build

build:
GOOS=darwin GOARCH=amd64 go build -o bin/dco-darwin-amd64 && \
GOOS=linux GOARCH=amd64 go build -o bin/dco-linux-amd64
42 changes: 18 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,50 @@
# 🐳 Docker Color Output
# 🐳 Docker Color Output 2.x

This package allows you to run Docker commands and get color output.

## Requirements

- **php** >= 7.0
This package allows you to colorize the docker output.

## ⚡️ Installation

Clone the repo and add the following lines to `~/.bash_aliases` (`~/.bashrc`, `~/.zshrc`) file.
Download the required binary file for your operating system from the [releases page](../../releases/latest).

```bash
DOCKER_COLOR_OUTPUT_PATH='/absolute-path-to-cloned-repo'
alias di="$DOCKER_COLOR_OUTPUT_PATH/bin/docker-images"
alias dps="$DOCKER_COLOR_OUTPUT_PATH/bin/docker-ps"
alias dcps="$DOCKER_COLOR_OUTPUT_PATH/bin/docker-compose-ps"
```
### Aliases

**Note:** change `DOCKER_COLOR_OUTPUT_PATH` to your absolute path where you cloned the repository.
For convenience, you can use the aliases from the [bash/aliases.sh](bash/aliases.sh) file. Update
the `DOCKER_COLOR_OUTPUT_PATH` variable and run the `source bash/aliases.sh` command.

## 💥 Usage

You can also pass all arguments as you pass to the command.

### 💡 Docker images

```bash
# The 'docker images' command will be called.
di
di # alias
```

```bash
docker images | dco
```

![docker images](https://user-images.githubusercontent.com/5787193/93581956-7ae7f580-f9aa-11ea-8f81-d6922e1ca892.png)

### 💡 Docker ps

```bash
# The 'docker ps' command will be called.
dps
dps [-a] # alias
```

```bash
# The 'docker ps -a' command will be called.
dps -a
docker ps [-a] | dco
```

![docker ps](https://user-images.githubusercontent.com/5787193/93581144-69521e00-f9a9-11ea-86bb-c23d7879c689.png)

### 💡 Docker compose

```bash
# The 'docker-compose ps' command will be called.
dcps
dcps # alias
```

```bash
docker-compose ps | dco
```

![docker-compose ps](https://user-images.githubusercontent.com/5787193/93630916-7267dd00-f9f3-11ea-9521-e69152fa86f1.png)
15 changes: 15 additions & 0 deletions bash/aliases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

DOCKER_COLOR_OUTPUT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/bin/dco-darwin-amd64"

di() {
docker images $@ | $DOCKER_COLOR_OUTPUT_PATH
}

dps() {
docker ps $@ | $DOCKER_COLOR_OUTPUT_PATH
}

dcps() {
docker-compose ps $@ | $DOCKER_COLOR_OUTPUT_PATH
}
173 changes: 0 additions & 173 deletions bin/docker-compose-ps

This file was deleted.

Loading

0 comments on commit 32ee881

Please sign in to comment.