Mercurial > hg > zsh-env
annotate zshrc-docker @ 160:c35d56590441
add the two helper scripts for gentoo that are requied on all hosts
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Mon, 23 Dec 2019 11:41:35 +0100 |
parents | bb583ebb33e6 |
children |
rev | line source |
---|---|
82
0caebb6fae8d
move the helpers for docker into a separate file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 # |
0caebb6fae8d
move the helpers for docker into a separate file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 # Useful aliases and functions for docker |
0caebb6fae8d
move the helpers for docker into a separate file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 # |
0caebb6fae8d
move the helpers for docker into a separate file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
4 |
137
8b961f7d78d9
rearrange the fields to be more copy/paste friendly
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
136
diff
changeset
|
5 alias dim="docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}'" |
8b961f7d78d9
rearrange the fields to be more copy/paste friendly
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
136
diff
changeset
|
6 alias dims="docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.Size}}'" |
102 | 7 alias dlf="docker logs -f" |
83
75a2fb4e6887
use a non-conflicting alias for docker-compose
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
82
diff
changeset
|
8 alias doc="docker-compose" |
84
e14200194f68
add an alias when misspelling docker
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
83
diff
changeset
|
9 alias doker=docker |
82
0caebb6fae8d
move the helpers for docker into a separate file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
10 alias dpa="docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}'" |
150
bb583ebb33e6
added another alias for docker
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
141
diff
changeset
|
11 alias dsh="docker run -it --rm --entrypoint /bin/sh" |
82
0caebb6fae8d
move the helpers for docker into a separate file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 |
0caebb6fae8d
move the helpers for docker into a separate file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
13 dex() { docker exec -it $1 /bin/sh } |
141
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
14 |
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
15 docker_remove_obsolete_images() { |
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
16 docker rmi $(docker images --format 'table {{.Repository}} {{.ID}}' | grep -e '^<none>' | awk '{ print $2 }') |
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
17 } |
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
18 |
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
19 docker_remove_exited_containers() { |
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
20 docker rm $(docker ps -a | grep "Exited" | awk '{print $(NF)}') |
fe986adeadeb
add more helper functions
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
137
diff
changeset
|
21 } |