1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-10-23 21:23:44 +08:00

feat(docker-compose): add aliases for --watch (#13203)

This commit is contained in:
Piotr Minkina
2026-10-13 10:36:54 +02:00
committed by GitHub
parent 083c339e06
commit 55c9071ee7
2 changed files with 31 additions and 25 deletions

View File

@@ -13,28 +13,32 @@ plugins=(... docker-compose)
## Aliases ## Aliases
| Alias | Command | Description | | Alias | Command | Description |
|-----------|----------------------------------|----------------------------------------------------------------------------------| |-----------|-------------------------------------|----------------------------------------------------------------------------------------------|
| dco | `docker-compose` | Docker-compose main command | | dco | `docker-compose` | Docker-compose main command |
| dcb | `docker-compose build` | Build containers | | dcb | `docker-compose build` | Build containers |
| dcc | `docker-compose config` | Parse, resolve and render compose file in canonical format | | dcc | `docker-compose config` | Parse, resolve and render compose file in canonical format |
| dce | `docker-compose exec` | Execute command inside a container | | dce | `docker-compose exec` | Execute command inside a container |
| dcps | `docker-compose ps` | List containers | | dcps | `docker-compose ps` | List containers |
| dcrestart | `docker-compose restart` | Restart container | | dcrestart | `docker-compose restart` | Restart container |
| dcrm | `docker-compose rm` | Remove container | | dcrm | `docker-compose rm` | Remove container |
| dcr | `docker-compose run` | Run a command in container | | dcr | `docker-compose run` | Run a command in container |
| dcstop | `docker-compose stop` | Stop a container | | dcstop | `docker-compose stop` | Stop a container |
| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service | | dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service |
| dcupb | `docker-compose up --build` | Same as `dcup`, but build images before starting containers | | dcupb | `docker-compose up --build` | Same as `dcup`, but build images before starting containers |
| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon | | dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon |
| dcupdb | `docker-compose up -d --build` | Same as `dcup`, but build images before starting containers and starts as daemon | | dcupdb | `docker-compose up -d --build` | Same as `dcup`, but build images before starting containers and starts as daemon |
| dcdn | `docker-compose down` | Stop and remove containers | | dcupw | `docker-compose up --watch` | Watch changes in service and rebuild/restart accordingly (see [Use Compose Watch] for usage) |
| dcl | `docker-compose logs` | Show logs of container | | dcupwb | `docker-compose up --watch --build` | Same as `dcupw`, but build images before starting containers |
| dclf | `docker-compose logs -f` | Show logs and follow output | | dcdn | `docker-compose down` | Stop and remove containers |
| dclF | `docker-compose logs -f --tail0` | Just follow recent logs | | dcl | `docker-compose logs` | Show logs of container |
| dcpull | `docker-compose pull` | Pull image of a service | | dclf | `docker-compose logs -f` | Show logs and follow output |
| dcstart | `docker-compose start` | Start a container | | dclF | `docker-compose logs -f --tail0` | Just follow recent logs |
| dck | `docker-compose kill` | Kills containers | | dcpull | `docker-compose pull` | Pull image of a service |
| dcv | `docker-compose version` | Show version information | | dcstart | `docker-compose start` | Start a container |
| dcsts | `docker-compose stats` | Show stats of containers | | dck | `docker-compose kill` | Kills containers |
| dci | `docker-compose images` | List images | | dcv | `docker-compose version` | Show version information |
| dcsts | `docker-compose stats` | Show stats of containers |
| dci | `docker-compose images` | List images |
[Use Compose Watch]: https://docs.docker.com/compose/how-tos/file-watch/

View File

@@ -17,6 +17,8 @@ alias dcup="$dccmd up"
alias dcupb="$dccmd up --build" alias dcupb="$dccmd up --build"
alias dcupd="$dccmd up -d" alias dcupd="$dccmd up -d"
alias dcupdb="$dccmd up -d --build" alias dcupdb="$dccmd up -d --build"
alias dcupw="$dccmd up --watch"
alias dcupwb="$dccmd up --watch --build"
alias dcdn="$dccmd down" alias dcdn="$dccmd down"
alias dcl="$dccmd logs" alias dcl="$dccmd logs"
alias dclf="$dccmd logs -f" alias dclf="$dccmd logs -f"