Add alias for getting network info about docker containers

This commit is contained in:
Eric Torres 2023-01-03 13:19:14 -08:00
parent e434919210
commit 6dd8b00ad7

View File

@ -67,6 +67,7 @@ alias ll='ls --classify --color --group-directories-first --human-readable -l'
# system
alias bootloader='cd /boot/loader/entries'
alias restartfans='sudo systemctl restart fancontrol.service'
alias dcips=$'docker inspect -f \'{{.Name}}-{{range $k, $v := .NetworkSettings.Networks}}{{$k}}-{{.IPAddress}} {{end}}-{{range $k, $v := .NetworkSettings.Ports}}{{ if not $v }}{{$k}} {{end}}{{end}} -{{range $k, $v := .NetworkSettings.Ports}}{{ if $v }}{{$k}} => {{range . }}{{ .HostIp}}:{{.HostPort}}{{end}}{{end}} {{end}}\' $(docker ps -aq) | column -t -s-'
# zsh
alias zdotdir='cd -- ${ZDOTDIR}'