From f37d47fe3cccc1ae2d780f1993d62752b4440cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?As=C4=B1m=20Tahir?= Date: Sat, 13 Jan 2024 20:28:36 +0300 Subject: [PATCH 1/2] feat: add `dps` and `dpsa` abbrs --- README.md | 2 ++ functions/_docker.abbrs.fish | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 3303e9c..a7874c0 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ abbr --show | grep dstopa | `dcin` | `docker container inspect` | | `dcls` | `docker container ls` | | `dclsa` | `docker container ls -a` | +| `dps` | `docker ps` | +| `dpsa` | `docker ps -a` | | `dlo` | `docker container logs` | | `dpo` | `docker container port` | | `dr` | `docker container run` | diff --git a/functions/_docker.abbrs.fish b/functions/_docker.abbrs.fish index 84d5bce..c81fefd 100644 --- a/functions/_docker.abbrs.fish +++ b/functions/_docker.abbrs.fish @@ -14,6 +14,8 @@ function _docker.abbrs -d "Initialize Docker abbreviations" abbr -a -g dcin docker container inspect abbr -a -g dcls docker container ls abbr -a -g dclsa docker container ls -a + abbr -a -g dps docker ps + abbr -a -g dpsa docker ps -a abbr -a -g dlo docker container logs abbr -a -g dpo docker container port abbr -a -g dr docker container run From ebe05fab7dd7c7f561abbba1653fb560abafb184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?As=C4=B1m=20Tahir?= Date: Sat, 13 Jan 2024 20:30:53 +0300 Subject: [PATCH 2/2] feat: add `ddrmi` abbr --- README.md | 30 ++++++++++++++++-------------- functions/_docker.abbrs.fish | 1 + 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a7874c0..0e7b498 100644 --- a/README.md +++ b/README.md @@ -36,15 +36,16 @@ abbr --show | grep dstopa ### Image -| Abbreviation | Command | -| ------------ | ---------------------- | -| `dib` | `docker image build` | -| `dii` | `docker image inspect` | -| `dils` | `docker image ls` | -| `dis` | `docker images` | -| `dipu` | `docker image push` | -| `dirm` | `docker image rm` | -| `dit` | `docker image tag` | +| Abbreviation | Command | +| ------------ | ---------------------------- | +| `dib` | `docker image build` | +| `dii` | `docker image inspect` | +| `dils` | `docker image ls` | +| `dis` | `docker images` | +| `dipu` | `docker image push` | +| `dirm` | `docker image rm` | +| `ddrmi` | remove all unused images[^1] | +| `dit` | `docker image tag` | ### Container @@ -90,9 +91,9 @@ abbr --show | grep dstopa | Abbreviation | Command | | ------------ | ------------------------------- | -| `dpl`[^1] | `docker pull` | +| `dpl`[^2] | `docker pull` | | `dbl` | `docker build` | -| `dstopa`[^2] | stop all running containers[^3] | +| `dstopa`[^3] | stop all running containers[^4] | | `dtop` | `docker top` | # Credit @@ -112,6 +113,7 @@ Base structure heavily inspired from [`jhillyerd/plugin-git`](https://github.com [fisher]: https://github.com/jorgebucaran/fisher [license-badge]: https://img.shields.io/badge/license-MIT-007EC7.svg?style=flat-square -[^1]: The original abbreviation in [`Oh My Zsh`][omz]'s [Docker plugin][omz-docker-plugin] for the `docker pull` command is [`dpu`](https://github.com/ohmyzsh/ohmyzsh/blob/7d5e12500a2ba0b575ffafcbb516568973528730/plugins/docker/docker.plugin.zsh#L19) but renamed as `dpl` is more meaningful. -[^2]: The original abbreviation in [`Oh My Zsh`][omz]'s [Docker plugin][omz-docker-plugin] for the `docker stop (docker ps -q)` command is [`dsta`](https://github.com/ohmyzsh/ohmyzsh/blob/7d5e12500a2ba0b575ffafcbb516568973528730/plugins/docker/docker.plugin.zsh#L26C7-L26C11) but renamed as `dstopa` is more meaningful. -[^3]: `docker stop (docker ps -q)` command stops all running containers. +[^1]: `docker rmi (docker images --filter "dangling=true" -q --no-trunc)` command removes all dangling images, which are untagged images that are not referenced by any container. +[^2]: The original abbreviation in [`Oh My Zsh`][omz]'s [Docker plugin][omz-docker-plugin] for the `docker pull` command is [`dpu`](https://github.com/ohmyzsh/ohmyzsh/blob/7d5e12500a2ba0b575ffafcbb516568973528730/plugins/docker/docker.plugin.zsh#L19) but renamed as `dpl` is more meaningful. +[^3]: The original abbreviation in [`Oh My Zsh`][omz]'s [Docker plugin][omz-docker-plugin] for the `docker stop (docker ps -q)` command is [`dsta`](https://github.com/ohmyzsh/ohmyzsh/blob/7d5e12500a2ba0b575ffafcbb516568973528730/plugins/docker/docker.plugin.zsh#L26C7-L26C11) but renamed as `dstopa` is more meaningful. +[^4]: `docker stop (docker ps -q)` command stops all running containers. diff --git a/functions/_docker.abbrs.fish b/functions/_docker.abbrs.fish index c81fefd..85b4a46 100644 --- a/functions/_docker.abbrs.fish +++ b/functions/_docker.abbrs.fish @@ -8,6 +8,7 @@ function _docker.abbrs -d "Initialize Docker abbreviations" abbr -a -g dis docker images abbr -a -g dipu docker image push abbr -a -g dirm docker image rm + abbr -a -g ddrmi 'docker rmi (docker images --filter "dangling=true" -q --no-trunc)' # remove all unused images abbr -a -g dit docker image tag # Container