-
Notifications
You must be signed in to change notification settings - Fork 36
/
alias.zsh
254 lines (238 loc) · 8.18 KB
/
alias.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
#
# Defines Docker aliases.
#
# Author:
# François Vantomme <[email protected]>
#
#
# Aliases
#
# Docker
alias dk='docker'
alias dka='docker attach'
alias dkb='docker build'
alias dkd='docker diff'
alias dkdf='docker system df'
alias dke='docker exec'
alias dkE='docker exec -e COLUMNS=`tput cols` -e LINES=`tput lines` -i -t'
alias dkh='docker history'
alias dki='docker images'
alias dkin='docker inspect'
alias dkim='docker import'
alias dkk='docker kill'
alias dkkh='docker kill -s HUP'
alias dkl='docker logs'
alias dkL='docker logs -f'
alias dkli='docker login'
alias dklo='docker logout'
alias dkls='docker ps'
alias dkp='docker pause'
alias dkP='docker unpause'
alias dkpl='docker pull'
alias dkph='docker push'
alias dkps='docker ps'
alias dkpsa='docker ps -a'
alias dkr='docker run'
alias dkR='docker run -e COLUMNS=`tput cols` -e LINES=`tput lines` -i -t --rm'
alias dkRe='docker run -e COLUMNS=`tput cols` -e LINES=`tput lines` -i -t --rm --entrypoint /bin/bash'
alias dkRM='docker system prune'
alias dkrm='docker rm'
alias dkrmi='docker rmi'
alias dkrn='docker rename'
alias dks='docker start'
alias dkS='docker restart'
alias dkss='docker stats'
alias dksv='docker save'
alias dkt='docker tag'
alias dktop='docker top'
alias dkup='docker update'
alias dkV='docker volume'
alias dkv='docker version'
alias dkw='docker wait'
alias dkx='docker stop'
## Container (C)
alias dkC='docker container'
alias dkCa='docker container attach'
alias dkCcp='docker container cp'
alias dkCd='docker container diff'
alias dkCe='docker container exec'
alias dkCE='docker container exec -e COLUMNS=`tput cols` -e LINES=`tput lines` -i -t'
alias dkCin='docker container inspect'
alias dkCk='docker container kill'
alias dkCl='docker container logs'
alias dkCL='docker container logs -f'
alias dkCls='docker container ls'
alias dkCp='docker container pause'
alias dkCpr='docker container prune'
alias dkCrn='docker container rename'
alias dkCS='docker container restart'
alias dkCrm='docker container rm'
alias dkCr='docker container run'
alias dkCR='docker container run -e COLUMNS=`tput cols` -e LINES=`tput lines` -i -t --rm'
alias dkCRe='docker container run -e COLUMNS=`tput cols` -e LINES=`tput lines` -i -t --rm --entrypoint /bin/bash'
alias dkCs='docker container start'
alias dkCss='docker container stats'
alias dkCx='docker container stop'
alias dkCtop='docker container top'
alias dkCP='docker container unpause'
alias dkCup='docker container update'
alias dkCw='docker container wait'
## Image (I)
alias dkI='docker image'
alias dkIb='docker image build'
alias dkIh='docker image history'
alias dkIim='docker image import'
alias dkIin='docker image inspect'
alias dkIls='docker image ls'
alias dkIpr='docker image prune'
alias dkIpl='docker image pull'
alias dkIph='docker image push'
alias dkIrm='docker image rm'
alias dkIsv='docker image save'
alias dkIt='docker image tag'
alias dkIf='function dkIf_(){ docker images -f "reference=*/*/$1*" -f "reference=*$1*" }; dkIf_'
## Volume (V)
alias dkV='docker volume'
alias dkVin='docker volume inspect'
alias dkVls='docker volume ls'
alias dkVpr='docker volume prune'
alias dkVrm='docker volume rm'
## Network (N)
alias dkN='docker network'
alias dkNs='docker network connect'
alias dkNx='docker network disconnect'
alias dkNin='docker network inspect'
alias dkNls='docker network ls'
alias dkNpr='docker network prune'
alias dkNrm='docker network rm'
## System (Y)
alias dkY='docker system'
alias dkYdf='docker system df'
alias dkYpr='docker system prune'
## Stack (K)
alias dkK='docker stack'
alias dkKls='docker stack ls'
alias dkKps='docker stack ps'
alias dkKrm='docker stack rm'
## Swarm (W)
alias dkW='docker swarm'
## CleanUp (rm)
# Clean up exited containers (docker < 1.13)
alias dkrmC='docker rm $(docker ps -qaf status=exited)'
# Clean up dangling images (docker < 1.13)
alias dkrmI='docker rmi $(docker images -qf dangling=true)'
# Pull all tagged images
alias dkplI='docker images --format "{{ .Repository }}" | grep -v "^<none>$" | xargs -L1 docker pull'
# Clean up dangling volumes (docker < 1.13)
alias dkrmV='docker volume rm $(docker volume ls -qf dangling=true)'
# Docker Machine (m)
alias dkm='docker-machine'
alias dkma='docker-machine active'
alias dkmcp='docker-machine scp'
alias dkmin='docker-machine inspect'
alias dkmip='docker-machine ip'
alias dkmk='docker-machine kill'
alias dkmls='docker-machine ls'
alias dkmpr='docker-machine provision'
alias dkmps='docker-machine ps'
alias dkmrg='docker-machine regenerate-certs'
alias dkmrm='docker-machine rm'
alias dkms='docker-machine start'
alias dkmsh='docker-machine ssh'
alias dkmst='docker-machine status'
alias dkmS='docker-machine restart'
alias dkmu='docker-machine url'
alias dkmup='docker-machine upgrade'
alias dkmv='docker-machine version'
alias dkmx='docker-machine stop'
# Docker Compose (c)
if [[ $(uname -s) == "Linux" ]]; then
alias dkc='docker-compose'
alias dkcb='docker-compose build'
alias dkcB='docker-compose build --no-cache'
alias dkccf='docker-compose config'
alias dkccr='docker-compose create'
alias dkcd='docker-compose down'
alias dkce='docker-compose exec -e COLUMNS=`tput cols` -e LINES=`tput lines`'
alias dkcev='docker-compose events'
alias dkci='docker-compose images'
alias dkck='docker-compose kill'
alias dkcl='docker-compose logs'
alias dkcL='docker-compose logs -f'
alias dkcls='docker-compose ps'
alias dkcp='docker-compose pause'
alias dkcP='docker-compose unpause'
alias dkcpl='docker-compose pull'
alias dkcph='docker-compose push'
alias dkcpo='docker-compose port'
alias dkcps='docker-compose ps'
alias dkcr='docker-compose run -e COLUMNS=`tput cols` -e LINES=`tput lines`'
alias dkcR='docker-compose run -e COLUMNS=`tput cols` -e LINES=`tput lines` --rm'
alias dkcrm='docker-compose rm'
alias dkcs='docker-compose start'
alias dkcsc='docker-compose scale'
alias dkcS='docker-compose restart'
alias dkct='docker-compose top'
alias dkcu='docker-compose up'
alias dkcU='docker-compose up -d'
alias dkcv='docker-compose version'
alias dkcx='docker-compose stop'
else
alias dkc='docker compose'
alias dkcb='docker compose build'
alias dkcB='docker compose build --no-cache'
alias dkccp='docker compose copy'
alias dkccr='docker compose create'
alias dkccv='docker compose convert'
alias dkcd='docker compose down'
alias dkce='docker compose exec -e COLUMNS=`tput cols` -e LINES=`tput lines`'
alias dkcev='docker compose events'
alias dkci='docker compose images'
alias dkck='docker compose kill'
alias dkcl='docker compose logs'
alias dkcL='docker compose logs -f'
alias dkcls='docker compose ls'
alias dkcp='docker compose pause'
alias dkcP='docker compose unpause'
alias dkcpl='docker compose pull'
alias dkcph='docker compose push'
alias dkcpo='docker compose port'
alias dkcps='docker compose ps'
alias dkcr='docker compose run -e COLUMNS=`tput cols` -e LINES=`tput lines`'
alias dkcR='docker compose run -e COLUMNS=`tput cols` -e LINES=`tput lines` --rm'
alias dkcrm='docker compose rm'
alias dkcs='docker compose start'
alias dkcsc='docker-compose scale'
alias dkcS='docker compose restart'
alias dkct='docker compose top'
alias dkcu='docker compose up'
alias dkcU='docker compose up -d'
alias dkcv='docker-compose version'
alias dkcx='docker compose stop'
fi
# Mutagen
alias mg='mutagen'
alias mgc='mutagen compose'
alias mgcb='mutagen compose build'
alias mgcB='mutagen compose build --no-cache'
alias mgcd='mutagen compose down'
alias mgce='mutagen compose exec -e COLUMNS=`tput cols` -e LINES=`tput lines`'
alias mgck='mutagen compose kill'
alias mgcl='mutagen compose logs'
alias mgcL='mutagen compose logs -f'
alias mgcls='mutagen compose ps'
alias mgcp='mutagen compose pause'
alias mgcP='mutagen compose unpause'
alias mgcpl='mutagen compose pull'
alias mgcph='mutagen compose push'
alias mgcps='mutagen compose ps'
alias mgcr='mutagen compose run -e COLUMNS=`tput cols` -e LINES=`tput lines`'
alias mgcR='mutagen compose run -e COLUMNS=`tput cols` -e LINES=`tput lines` --rm'
alias mgcrm='mutagen compose rm'
alias mgcs='mutagen compose start'
alias mgcsc='mutagen compose scale'
alias mgcS='mutagen compose restart'
alias mgcu='mutagen compose up'
alias mgcU='mutagen compose up -d'
alias mgcv='mutagen compose version'
alias mgcx='mutagen compose stop'